Complete Integration Module OAuth Flow
POST/homes/{homeId}/intmods/{configId}/oauth
Base URL: https://api.tinkermode.com
If an integration module includes an OAuth flow to connect with an external service, the frontend app should use this set of endpoints to manage the authentication process. This specific endpoint is used to complete the flow after the user is redirected back from the external service following a successful login. The frontend app must extract the state and code parameters from the URL and call this endpoint to validate the code, retrieve a client authentication token and store it in the backend.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain the API key of a user or service account who has the permission to request OAuth2 authorization tokens for the specified integration module configuration, or a Project API Key with admin permission.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
homeId | integer | Yes | The unique ID for a specified home. | |
configId | string | Yes | Integration Module Configuration ID |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
code | string | No | Code gotten from the OAuth flow. | |
redirectUri | string | No | Redirect URI for the OAuth flow. |
Request example
{
"code": "1234567890abcdef",
"redirectUri": "https://example.com/oauth/callback"
}Responses
204 OAuth2 authorization completed successfully.
401 Authorization is required to access this resource.
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |