Authorization

Authorization

From this article, you’ll learn how to get access to the Prepr REST API.

To access the Prepr API you first need to authenticate your app with an OAuth bearer token.

A token provides scoped access to a single environment, you need to obtain another token for every new environment you want to access. Organizations with an Enterprise plan can create access tokens on the organization level.

We recommend using different access tokens for different applications or front end applications, for example, one for an iOS app and another for Android app. This allows you to revoke them individually in the future and manage access independently.

Sign in to your Prepr account Go to https://signin.prepr.io (opens in a new tab) and sign in with your Prepr account credentials. Then navigate to the Environment you want to use.

Create an Access token
Go to Settings -> Access tokens and click Add access token.

Enter a name and select scopes to give the new token API access. In most cases just adding content_items is sufficient.

Click save and copy the generated access token, you need this later.

To authenticate include a Authorization HTTP header containing the access token in your request.

curl -v https://cdn.prepr.io/{{endpoint}} -H 'Authorization: Bearer sdfg...'

Or

curl -v https://api.eu1.prepr.io/{{endpoint}} -H 'Authorization: Bearer sdfg...'

If you fail to include a valid access token, the endpoint will return a status code 401.

Was this article helpful?

We’d love to learn from your feedback