Teem Developer Portal

Optimize your new digital workspace with the Teem developers API.

Registering your app for the Teem API

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

1

Authorize

Give your user a link, which redirects them to Teem's authorization endpoint with the appropriate query parameters.

Auth Code Request Endpoint
https://app.teem.com/oauth/authorize/
Query Parameters for Auth Code Request

NameTypeDescription
client_idstringRequired. The client ID that you received from Teem when you registered your application.
redirect_uristringRequired. Must match the callback URL that you supplied during application registration. This is the URL where users will be sent after authorization.
response_typestringRequired. Must be set to "code" to request an authorization code.
scopestringRequired. See the API docs for the endpoints you want to use to determine the scopes you need. We recommend that you always request the user scope.
statestringRecommended. An unguessable random string, used to protect against request forgery attacks.

Example:
https://app.teem.com/oauth/authorize/?client_id=<app_id>&redirect_uri=http://example.com/callback&response_type=code&scope=user
2

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:

https://example.com/callback?code=$RESPONSE_CODE&state=$OPTIONAL_STATE_STRING
3

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
https://app.teem.com/oauth/token/
Token Request POST Parameters

NameTypeDescription
client_idstringRequired. The client ID that you received from Teem when you registered your application.
client_secretstringRequired. The client secret that you were given from Teem when you registered.
grant_typestringRequired. Must be set to "authorization_code" for an access token request.
redirect_uristringRequired. Must match the callback URL that you supplied during application registration.
codestringRequired. The code that you received as a response in Step 2.

Example:
https://app.teem.com/oauth/token/?client_id=$APP_ID &client_secret=$APP_SECRET &grant_type=authorization_code &redirect_uri=http://example.com/callback &code=$RESPONSE_CODE
Token Request Response

The http response will include data:

NameTypeDescription
access_tokenstringToken used to authorize your API requests.
token_typestringType of access token, will generally be "Bearer"
expires_inintegerSeconds until the token expires, generally 3600
refresh_tokenstringToken to exchange used to receive a new access token without sending the user through the auth flow again.

4

Use the Access Token

To access an OAuth protected API you simply include bearer token authorization request header:

Authorization: Bearer $TOKEN
Example:
curl -X GET "https://app.teem.com/api/v4/accounts/users/me/" -H "Authorization: Bearer $TOKEN"
5

Use the Refresh Token

Refresh Tokens differ from Access tokens in that Access Tokens are temporary, and multi use, but Refresh Tokens are long lived and 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
https://app.teem.com/oauth/token/
Refresh Token POST Parameters

NameTypeDescription
client_idstringRequired.The client ID that you received from Teem when you registered your application.
client_secretstringRequired. The client secret that you were given from Teem when you registered.
grant_typestringRequired. Must be set to "refresh_token" for a refresh token request.
refresh_tokenstringRequired. The refresh_token given to you with your access_token in previous steps.

Example:
curl -X POST -d "client_id=$APP_ID &client_secret=$APP_SECRET &refresh_token=$REFRESH_TOKEN &grant_type=refresh_token" https://app.teem.com/oauth/token/
Token Request Response

The http response will include data:

NameTypeDescription
access_tokenstringToken used to authorize your API requests.
token_typestringType of access token, will generally be "Bearer"
expires_inintegerSeconds until the token expires, generally 3600
refresh_tokenstringToken to exchange used to receive a new access token without sending the user through the auth flow again.