User Oauth Token Actions
https://api.losant.com/me/oauth-tokens/OAUTH_TOKEN_ID
Below are the various requests that can be performed against the User Oauth Token resource, as well as the expected parameters and the potential responses.
Delete
Deletes an OAuth Token
Method And Url
DELETE https://api.losant.com/me/oauth-tokens/OAUTH_TOKEN_ID
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.User, only.User, userOauthToken.*, or userOauthToken.delete.
Request Path Components
| Path Component | Description | Example |
|---|---|---|
| OAUTH_TOKEN_ID | ID associated with the OAuth token | 575ec7417ae143cd83dc4a95 |
Request Headers
| Name | Required | Description | Default |
|---|---|---|---|
| Authorization | Y | The token for authenticating the request, prepended with Bearer |
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X DELETE \
https://api.losant.com/me/oauth-tokens/OAUTH_TOKEN_ID
Successful Responses
| Code | Type | Description |
|---|---|---|
| 200 | Success | If OAuth token was successfully deleted |
Error Responses
| Code | Type | Description |
|---|---|---|
| 400 | Error | Error if malformed request |
| 404 | Error | Error if OAuth token was not found |
Get
Retrieves information on an OAuth token
Method And Url
GET https://api.losant.com/me/oauth-tokens/OAUTH_TOKEN_ID
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.User, all.User.bounded, all.User.read, only.User, only.User.bounded, only.User.read, userOauthToken.*, or userOauthToken.get.
Request Path Components
| Path Component | Description | Example |
|---|---|---|
| OAUTH_TOKEN_ID | ID associated with the OAuth token | 575ec7417ae143cd83dc4a95 |
Request Headers
| Name | Required | Description | Default |
|---|---|---|---|
| Authorization | Y | The token for authenticating the request, prepended with Bearer |
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/me/oauth-tokens/OAUTH_TOKEN_ID
Successful Responses
| Code | Type | Description |
|---|---|---|
| 200 | User OAuth Token | OAuth token information |
Error Responses
| Code | Type | Description |
|---|---|---|
| 400 | Error | Error if malformed request |
| 404 | Error | Error if OAuth token was not found |
Patch
Updates information about an OAuth token
Method And Url
PATCH https://api.losant.com/me/oauth-tokens/OAUTH_TOKEN_ID
Authentication
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.User, only.User, userOauthToken.*, or userOauthToken.patch.
Request Path Components
| Path Component | Description | Example |
|---|---|---|
| OAUTH_TOKEN_ID | ID associated with the OAuth token | 575ec7417ae143cd83dc4a95 |
Request Headers
| Name | Required | Description | Default |
|---|---|---|---|
| Authorization | Y | The token for authenticating the request, prepended with Bearer |
Request Body
The body of the request should be serialized JSON that validates against the User OAuth Token Patch schema. For example, the following would be a valid body for this request:
{
"name": "Updated OAuth App Name",
"description": "Updated description",
"defaultRole": "edit",
"status": "inactive"
}
Curl Example
curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X PATCH \
-d '{"name":"Updated OAuth App Name","description":"Updated description","defaultRole":"edit","status":"inactive"}' \
https://api.losant.com/me/oauth-tokens/OAUTH_TOKEN_ID
Successful Responses
| Code | Type | Description |
|---|---|---|
| 200 | User OAuth Token | Updated OAuth token information |
Error Responses
| Code | Type | Description |
|---|---|---|
| 400 | Error | Error if malformed request |
| 404 | Error | Error if OAuth token was not found |
Schemas
Error
Schema for errors returned by the API
Error Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 2 keys
- ▶{} 1 key
- ▶{} 1 key
Error Example
- ▶{} 2 keys
- "NotFound"
- "Application was not found"
Success
Schema for reporting a successful operation
Success Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 1 key
- ▶{} 2 keys
Success Example
- ▶{} 1 key
- true
User OAuth Token
Schema for a single OAuth Token
User OAuth Token Schema
- ▶{} 3 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 12 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 3 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 3 keys
- ▶{} 4 keys
- ▶{} 2 keys
- ▶{} 2 keys
User OAuth Token Example
- ▶{} 11 keys
- "575ec7417ae143cd83dc4a95"
- "575ec7417ae143cd83dc4a95"
- "My OAuth App"
- "OAuth application for automation"
- "2016-06-13T04:00:00.000Z"
- "2016-06-13T04:00:00.000Z"
- ▶[] 2 items
- "view"
- [] 0 items
- "active"
- ▶{} 6 keys
User OAuth Token Patch
Schema for the body of an OAuth Token modification request
User OAuth Token Patch Schema
- ▶{} 4 keys
- "http://json-schema.org/draft-07/schema#"
- "object"
- ▶{} 5 keys
- ▶{} 3 keys
- ▶{} 2 keys
- ▶{} 2 keys
- ▶{} 3 keys
- ▶{} 2 keys
- false
User OAuth Token Patch Example
- ▶{} 4 keys
- "Updated OAuth App Name"
- "Updated description"
- "edit"
- "inactive"
Was this page helpful?
Still looking for help? You can also search the Losant Forums or submit your question there.