Teem Developer Portal
Optimize your new digital workspace with the Teem developers API.
Registering your app for the Teem API
These are meant for developers experienced in working with APIs and are sufficient to get you started using ours. If you would like additional information regarding how to use an API for the first time, check out this free online course or contact us for a consultation with one of our Sales Engineers at [email protected].
To use the Teem API in your own app, you need to first register your app and receive a Client ID to represent your application in API calls.
Teem OAuth Flow
Authorize
Give your user a link, which redirects them to Teem's authorization endpoint with the appropriate query parameters.
Auth Code Request Endpoint
Query Parameters for Auth Code Request
Name | Type | Description |
---|---|---|
client_id | string | Required. The client ID that you received from Teem when you registered your application. |
redirect_uri | string | Required. Must match the callback URL that you supplied during application registration. This is the URL where users will be sent after authorization. |
response_type | string | Required. Must be set to "code" to request an authorization code. |
scope | string | Required. See the API docs for the endpoints you want to use to determine
the scopes you need. We recommend that you always request the users
scope. |
state | string | Recommended. An unguessable random string, used to protect against request forgery attacks. |
Example:
Authorization Response
The user logs into Teem and is asked to authorize your app with the scopes you have requested.
If the user authorizes the request, they will be redirected to the supplied redirect_uri along with an authorization code supplied as a query parameter. For example:
Request Access Token
You must now exchange the authorization code we return for an access token. This requires a POST request to the token endpoint.
Access Token Request Endpoint
Use below parameters in request body 'x-www-form-urlencoded'
Token Request POST Parameters
Name | Type | Description |
---|---|---|
client_id | string | Required. The client ID that you received from Teem when you registered your application. |
client_secret | string | Required. The client secret that you were given from Teem when you registered. |
grant_type | string | Required. Must be set to "authorization_code" for an access token request. |
redirect_uri | string | Required. Must match the callback URL that you supplied during application registration. |
code | string | Required. The code that you received as a response in Step 2. |
Example:
curl --location --request POST 'https://app.teem.com/oauth/token/'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'client_id=$CLIENT_ID'
--data-urlencode 'client_secret=$SECRET'
--data-urlencode 'grant_type=authorization_code'
--data-urlencode 'redirect_url=$REDIRECT_URI'
--data-urlencode 'code=$CODE'
Token Request Response
The http response will include data:
Name | Type | Description |
---|---|---|
access_token | string | Token used to authorize your API requests. |
token_type | string | Type of access token, will generally be "Bearer" |
expires_in | integer | Seconds until the token expires, generally 3600 |
refresh_token | string | Token to exchange used to receive a new access token without sending the user through the auth flow again. |
Use the Access Token
To access an OAuth protected API you simply include bearer token authorization request header:
Example:
Use the Refresh Token
Refresh Tokens differ from Access Tokens in that Access Tokens are short-lived and multi-use, but Refresh Tokens are valid for 90 days and are single-use. Using a Refresh Token will return a new Access Token and Refresh Token, allowing you to continue to use the API without having the user reauthorize.
Refresh Token Request Endpoint
Refresh Token POST Parameters
Name | Type | Description |
---|---|---|
client_id | string | Required.The client ID that you received from Teem when you registered your application. |
client_secret | string | Required. The client secret that you were given from Teem when you registered. |
grant_type | string | Required. Must be set to "refresh_token" for a refresh token request. |
refresh_token | string | Required. The refresh_token given to you with your access_token in previous steps. |
Example:
Token Request Response
The http response will include data:
Name | Type | Description |
---|---|---|
access_token | string | Token used to authorize your API requests. |
token_type | string | Type of access token, will generally be "Bearer" |
expires_in | integer | Seconds until the token expires, generally 3600 |
refresh_token | string | Token to exchange used to receive a new access token without sending the user through the auth flow again. |