https://support.tethr.com/hc/en-us/categories/115001740967-Developers Developers
https://support.tethr.com/hc/en-us/sections/115003048847-APIs APIs

Token authentication API

New feature: content organization, collaboration and filtering

This article describes a new feature that may not be available to all users. If you don't see this feature and want to learn more, please contact your Tethr admin.
Section only

Token authentication API

All requests are authorized via a OAuth2 bearer token. Requests for an access token should be made with an “authorization_code” or “client_credentials” grant type. Bearer token will be used and expire after a few hours, and will need to be refreshed. Expiration times will be returned with the token request, and represented in seconds from the time the token was issued.


Example token request

POST https://[INSTANCE NAME].Audio.tethr.io/Token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 124
Expect: 100-continue
Connection: Keep-Alive

grant_type=client_credentials&client_secret=[ApiUserPassword]&client_id=[ApiUsername]


Sample token request using cURL

curl -k -X POST "https://[INSTANCE NAME].Audio.Tethr.io/Token" -dclient_id=[ApiUsername] -dclient_secret=[ApiUserPassword] -dgrant_type=client_credentials


Response (if the token request is successful)

{
	"access_token": "[TOKEN]",
	"token_type": "bearer",
	"expires_in": 1799
}

 

Tip: All date and times must be in ISO 8601 format.