GET Access Token

To invoke an API call, you must have a valid Access Token generated using the valid application credentials

Get API Key and API Secret

Please log in to https://app.marsview.ai to get your apiKey and apiSecret

Note that only one set of API keys can be active for a given account and resetting the Credentials will make the old appID and appSecret invalid

To create a new set of API credentials goto Settings > Account Details > API Credentials and click on Reset Credentials.

The apiKey and apiSecret are automatically created during account creation, these values can be accessed under the Settings > Account Details > API Credentialssection.

Generating API Access Token

Using the apiKey and the apiSecret we can generate a accessToken which will be used to authenticate all the requests to the Speech Analytics API Bundle.

Note that the accessToken generated will be valid for 3600 seconds. Post which another accesstoken has to be generated.

post
Generate API Token

https://api.marsview.ai/cb/v1/auth/create_access_token
This method is used to generate a accessToken using the apiKey and apiSecret
Request
Response
Request
Headers
content-type
required
string
application-json
Body Parameters
userId
required
string
User ID / Email of the user
apiSecret
required
string
Insert apiSecret
apiKey
required
string
Insert apiKey
Response
200: OK
{
"status": true,
"data": {
"accessToken": "DummyAccessToken",
"expiresIn": 3600,
"tokenType": "Bearer"
}
}
401: Unauthorized
When the configuration of apiKey/secret is invalid
{
"status": false,
"error": "NJSCFE001",
"message": "A detailed error message will appear here"
}

Example Request: How to generate API Token

Shown below is a code snippet to generate an API token.

CURL
CURL
curl --location --request POST 'https://api.marsview.ai/cb/v1/auth/create_access_token' \
--header 'Content-Type: application/json' \
--data-raw '{
"apiKey": "Insert API Key",
"apiSecret": "Insert API Secret",
"userId": "[email protected]"
}'

Example Response

Shown below is a sample JSON response from the above request.

{
"status": true,
"data": {
"accessToken": "DummyAccessToken",
"expiresIn": 3600,
"tokenType": "Bearer"
}
}

‚Äč