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.

Generate API Token

POST https://api.marsview.ai/cb/v1/auth/create_access_token

This method is used to generate a accessToken using the apiKey and apiSecret

Headers

Request Body

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

Example Request: How to generate API Token

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

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":    "demo@marsview.ai"
}'

Example Response

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

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

Last updated