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

NameTypeRequiredConstraintsDescription
homeIdintegerYesThe unique ID for a specified home.
configIdstringYesIntegration Module Configuration ID

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
codestringNoCode gotten from the OAuth flow.
redirectUristringNoRedirect 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

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.