Gaining a Bearer Token ⚡

Now that you have your API key, you will need to create a 'bearer token' for your application to use the API

Contents:

Top-level bearer token acquisition process

Scopes explained 

Adding the scopes to your application

Bearer token URL construction

Example bearer token URL


 

Top-level bearer token acquisition process

The application will be authenticated by the user account that created it, as the API Key is tied to a user ID

This means that the user account with which the application was created will always show as the record creator when importing new records. You may want to consider creating a new user account - one that clearly identifies your application


Scopes explained 

Scopes define the permissions allowed by your application. 

readUsersData 

The application requires this scope to view records, media, and collections. 

User Story: The application shall be able to read any data available to the user who created the application.

modifyUsersData 

The application requires this scope to view and modify records, media, and collections. 

User Story: The application shall be able to modify any data available to the user who created the application.

manageJobs 

The application requires this scope to view and manage jobs and workflows  

User Story: The application shall be able to read any jobs visible to the user who created the application.

roles 

This scope is required for the application to search for a user or group 

User Story: The application shall be able to view any users and groups visible to the user who created the application.

createJobs 

This scope is required for the application to create and manage workflow jobs

User Story: The application shall be able to create and manage any jobs that are owned by the user who created the application. 

modifyRoles 

This scope is required for the application to modify users and email users 

User Story: The application shall be able to modify any users where the user who created the application has the correct permissions


Adding the scopes to your application

The Imagen Media Control Centre must assign scopes before constructing your bearer token URL


Bearer token URL construction

The next step is to construct a URL to gain your bearer token. The arguments passed by this URL are shown below in greater detail:

https://your_imagen_domain.com/oauth/authorize  Replace 'your_imagen_domain' with the FQDN of your Imagen domain
?response_type=token   (specifies that you are requesting a token in response)
&client_id=[Your API key here]  Enter the API key (obtained in the previous section)
&redirect_uri=urn:ietf:wg:oauth:2.0:oob&state=1 (specifies the default redirect value for an 'Installed Application')
&scope=readUsersData modifyUsersData  Select the scopes required by your application. It is vital that you understand the scopes before constructing a bearer token URL. 

Example bearer token URL:

https://[your_imagen_domain.com]/oauth/authorize?response_type=token &client_id=[Your_API key_here]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&state=1&scope=[readUsersData modifyUsersData]

User Story: The application shall be able to read and edit any data available to the user who created the application.

👉 Want to go further? Check out a sample response