RedShred uses a bearer token for authentication. Once you have your login credentials, you can access your bearer token at any time in your profile page.
Once you have this token, you can use it by setting the HTTP Authentication header as shown below (replacing $REDSHRED_AUTH_TOKEN
with your actual token value). We will use curl(1)
for many of the examples in this tutorial and will assume it’s been configured as described below.
This tutorial will use unix/macOS compatible syntax for local filepaths and commands. Windows users will be able to follow along exactly if using the Windows Subsystem For Linux (WSL). We refer you to the curl documentation regarding Windows installation if not using the WSL.
curl -H "Authorization: Token $REDSHRED_AUTH_TOKEN" https://api.redshred.com/v2/collections/
For the purposes of this tutorial, we’ll assume you have this and a few other simple options set in a file in your current directory called redshred-auth
. These will make using curl
easier for the purposes of this tutorial.
# Always send RedShred credentials with API calls
-H "Authorization: Token $REDSHRED_AUTH_TOKEN"
# Always prefer JSON replies from the server
-H "Accept: application/json"
With this in place, listing your collections (as shown above) should work as:
curl --config redshred-auth https://api.redshred.com/v2/collections/