Prerequisite: In order to run the collection below,
a Authentication_URL is required which will be provided by Cynopsis, which can then be set as a global variable
or in the enviroment created for Artemis in the Introduction section.
Artemis3 Postman Collection Link
Authentication URLs
Use the appropriate authentication URL depending on your environment.
| Environment | Authentication URL |
|---|
| UAT | https://crm-demo.cynopsis.co |
| PROD | https://crm.cynopsis.co |
Generate Token for a Guest
To generate a token, please make a POST API call to the following endpoint:
POST {{authentication_url}}/oauth/token
Requirements
The request must use the application/x-www-form-urlencoded format.
Content-Type: application/x-www-form-urlencoded
Body (form data)
grant_type=client_credentials
client_id=YOUR_CLIENT_ID
client_secret=YOUR_CLIENT_SECRET
Replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with the credentials provided by Cynopsis.
Sample HTTP Request
curl -X POST {{authentication_url}}/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"
Sample HTTP Response
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6...",
"token_type": "Bearer",
"expires_in": 3600
}
Get Access Token/Refresh Token Using Username and Password
POST {{authentication_url}}/oauth/token
Requirements
Use the application/x-www-form-urlencoded content type.
Content-Type: application/x-www-form-urlencoded
Body (form data)
grant_type=password
client_id=YOUR_CLIENT_ID
client_secret=YOUR_CLIENT_SECRET
username=USER_EMAIL
password=USER_PASSWORD
Replace the values accordingly. These credentials are required for authenticating the user.
Sample Request
Use application/x-www-form-urlencoded and URL-encode all values.
# Get access + refresh tokens with username/password
curl --location '{{authentication_url}}/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'client_id=YOUR_CLIENT_ID' \
--data-urlencode 'client_secret=YOUR_CLIENT_SECRET' \
--data-urlencode 'username=USER_EMAIL' \
--data-urlencode 'password=USER_PASSWORD'
Sample Response
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6...",
"token_type": "Bearer",
"expires_in": 3600
}
Using Refresh Token for User
To obtain a new access token using a valid refresh token (from above), make the following request:
POST {{authentication_url}}/oauth/token
Content-Type: application/x-www-form-urlencoded
Body (form data)
grant_type=refresh_token
refresh_token=USER_REFRESH_TOKEN
client_id=YOUR_CLIENT_ID
client_secret=YOUR_CLIENT_SECRET
Sample Request (Refresh)
# Refresh access token using a refresh token
curl --location '{{authentication_url}}/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'refresh_token=YOUR_REFRESH_TOKEN' \
--data-urlencode 'client_id=YOUR_CLIENT_ID' \
--data-urlencode 'client_secret=YOUR_CLIENT_SECRET'
Sample Response
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6...",
"token_type": "Bearer",
"expires_in": 3600
}