Skip to main content

Uniphore Customer Portal

Generate M2M token

The M2Mtoken is generated by the platform and is obtained by executing the cURL command. You should pass the client_id, client_secret, audience and grant_type. The url, client_id and client_secret are different for Production and Staging environments.

On successful validation, you receive a response with an access token. You can use the access token to request information from the U-Self Serve server.

Production Environment
Endpoint

Method: POST

URL: https://uniphore.us.auth0.com/oauth/token

curl --request POST \
  --url https://uniphore.us.auth0.com/oauth/token \
  --header 'content-type: application/json' \
  --data '{"client_id":"abcdefghij0123456789",
           "client_secret":"abcdefghijklmnopqrst12345",
           "audience":"api.uniphore.com",
           "grant_type":"client_credentials"}'
Request Parameter

Parameter Name

Data Type

Description

Required/ Optional

audience

String

Defines the intended receiver of the token. Enter api.uniphore.com which is the name of the logical group containing Uniphore APIs.

Required

client_id

String

Unique Id of the client.

Contact Cloud Admin for client_id.

Required

client_secret

String

Client secret for the given client id.

Contact Cloud Admin for client_secret.

Required

grant_type

String

Grant type is an authorization method. The client uses this to retrieve access token.

Enter client_credentials in grant_type.

Required

Example Response
curl --request POST \
--url https://uniphore.us.auth0.com/oauth/token \
--header 'content-type: application/json' \
--data '{"client_id":" abcdefghij0123456789","client_secret":" abcdefghijklmnopqrst12345","audience":"api.uniphore.com","grant_type":"client_credentials"}'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1047 0 852 100 195 1616 369 --:--:-- --:--:-- --:--:-- 1990
{"access_token":"eyJhbGciOiJSUzInR5cCI6IkpXVCIsImtpZCI6IkxYejBQYWVFRERuS3dfcjdkU2s2UyJ9.eyJodHRwczovsInN1YiI6IjFndVBBZ2t5T2NoWlFJeUNTRFNyQmd4R2p2Yk93YVJPQGNsaWVudHMiLCJhdWQiOiJhcGkudW5pcGhvcmUuY29tIiwiaWF0IjoxNjY2OTQ5MzU3LCJleHAiOjE2NjgxNTg5NTcsImF6cCI6IjFndVBBZ2t5T2NoWlFJeUNTRFNyQmd4R2p2Yk93YVJPIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIiwicGVybWlzc2lvbnMiOltdfQ.Y8BeWOlh40YWgDDoREAj_MeGVlkj0Jn3rCX0LXWqpVbNt8Jyynr80H1WdsLvcZYG2ZA9XLn1ziLFJqqqB4rgDQUqJz7Fu3a_727ruIRDU2chEXEqKHYzU9T88PIeG_t6apmQShk_G9c7bjAWbMB-2IyAVzqXwrtOlZRBQ0bjgAvoPeZF5pwX6BzZ4bQG9PuHDzvTsn2G5wPn2jlSYwlpAxC6_wbA3_z8H7FLTENnq0zM9BnJ2v1oKboM7cUIC2Ej39fesYBBObRYhKq57Q3Mn-iDa6PLmdzv0w-8IpBMEcsTX3kS1iOQ",
"expires_in":1209600,
"token_type":"Bearer"}
Staging Environment
Endpoint

Method: POST

URL: https://dev-g2j5mu2z.us.auth0.com/oauth/token

curl --request POST \
--url https://dev-g2j5mu2z.us.auth0.com/oauth/token \
--header 'content-type: application/json' \
--data
'{"client_id":"abcdefghij0123456789",
  "client_secret":"abcdefghijklmnopqrstuvwxyz1234567890",
  "audience":"api.uniphore.com",
  "grant_type":"client_credentials"}'
Request Parameter

Parameter Name

Data Type

Description

Required/ Optional

audience

String

Defines the intended receiver of the token. Enter api.uniphore.com which is the name of the logical group containing Uniphore APIs.

Required

client_id

String

Unique Id of the client.

Contact Cloud Admin for client_id.

Required

client_secret

String

Client secret for the given client id.

Contact Cloud Admin for client_secret.

Required

grant_type

String

Grant type is an authorization method. The client uses this to retrieve access token.

Enter client_credentials in grant_type.

Required

Example Response
curl --request POST \
--url https://dev-g2j5mu2z.us.auth0.com/oauth/token \
--header 'content-type: application/json' \
--data '{"client_id":"abcdefghij0123456789","client_secret":" abcdefghijklmnopqrstuvwxyz1234567890","audience":"api.uniphore.com","grant_type":"client_credentials"}'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1047 0 852 100 195 1616 369 --:--:-- --:--:-- --:--:-- 1990
{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkxYejBQYWVFRERuS3dfcjdkU2s2UyJ9.eyJodHRwczovL2FwaS51bmlwaG9yZS5jb20vYmF6IjoiYmF6ISEhIiwiaXNzIjoiaHR0cHM6Ly9kZW11MnoudXMuYXV0aDAuY29tLyIsInN1YiI6IjFndVBBZ2t5T2NoWlFJeUNTRFNyQmd4R2p2Yk93YVJPQGNsaWVudHMiLCJhdWudW5pcGhvcmUuY29tIiwiaWF0IjoxNjY2OTQ5MzU3LCJleHAiOjE2NjgxNTg5NTcsImF6cCI6IjFndVBBZ2t5T2NoWlFJeR2p2Yk93YVJPIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIiwicGVybWlzc2lvbnMiOltdfQ.Y8BeWOlh40YWgDDoREAj_MeGVlkj0Jn3rCX0LXWqpVbNt8Jyynr80H1WdsLvcZYG2UqJz7Fu3a_727ruIRDU2chEXEqKTNU0DRFp5ER5nHYzU9T88PIeG_t6apmQShk_G9c7bjAWbMB-2IyAVzqXwrtOlZRBQ0bjgAvoPeZF5pwX6BTsn2G5wPn2jlSYwlpAxC6_wbA3_z8H7FLTENnq0zM9BnJ2v1oKboM7cUIC2Ej3Vt0gQNTYXNM3SR9fesYBBObRYhKq57Q3Mn-iDa6PLmdzv0w-8IpBMEcsTX3kS1iOQ",
"expires_in":1209600,
"token_type":"Bearer"}