Every API call needs an access token. You get one by sending a POST request to the token endpoint. This request does not use a Bearer token.
The Request
POST https://app.cuseum.com/oauth/token
Send these as URL parameters. All are required:
Parameter | Description | Example |
| Use |
|
| Email of the Cuseum user who is authenticating. | |
| Password of that Cuseum user. |
|
| UID of the OAuth application. |
|
| Secret of the OAuth application. |
|
| Space-separated scopes enabled for the integration. |
|
| ID of the museum the user belongs to. |
|
Replace every placeholder with a URL-encoded value (for example, @ becomes %40 and a space becomes %20).
cURL Example
curl --request POST \ 'https://app.cuseum.com/oauth/token?grant_type=password&email=user%40example.com&password=%3Cuser-password%3E&client_id=%3Cclient-id%3E&client_secret=%3Cclient-secret%3E&scope=public%20read_external_users%20read_pass_books&museum_id=%3Cmuseum-id%3E'
Using Postman or Another API Client
Create a new request and set the method to POST.
Set the URL to
https://app.cuseum.com/oauth/token.Add the fields from the table above as URL parameters.
Do not add a Bearer token.
Send the request and save the returned
access_tokensecurely.
A Successful Response
{
"access_token": "<access-token>",
"refresh_token": "<refresh-token>",
"token_type": "Bearer",
"expires_in": 7200,
"scope": "public read_external_users read_pass_books",
"created_at": 1710000000
}Treat token values as opaque. expires_in is the token lifetime in seconds (7200 in the reference example, which is two hours).
Use the Token
Add this header to every later request:
Authorization: Bearer <access-token>
When the token expires or stops working, request a new one. Reuse one token for many calls instead of requesting a token for every page.
If It Fails
See Handle Errors and Troubleshoot. For credentials or access questions, contact [email protected].
