Vehicles

Create a vehicle authorization link

Changed on

Required scope: vehicles:write. Returns the link an application user follows to authorize their vehicle account (e.g. Enode or Smartcar) so it can be connected to Monta.

post/api/v1/vehicles/integrations/authorization-link

Request

  • Base URL
    https://partner-api.monta.com
  • URL
    https://partner-api.monta.com/api/v1/vehicles/integrations/authorization-link
  • Auth
    HTTP bearer

Request body

userIdinteger required

Id of the application user the authorization link is created for

redirectUristring required

URI the user is redirected to after authorizing their vehicle account. Must be an https:// URL.

provider'enode' | 'smartcar' nullable

Vehicle integration provider. Defaults to enode when omitted.

brandIdinteger nullable

Vehicle brand id used to pick a provider-specific authorization flow

scopesstring[] nullable

Scopes requested from the vehicle account. Defaults to charge-state and control-charging. charge-state also grants the odometer, location the vehicle's location, all every scope. Smartcar always requests every scope.

Example request

{
  "userId": 10000,
  "redirectUri": "https://example.com/vehicle/callback",
  "provider": "enode",
  "brandId": 1234,
  "scopes": [
    "charge-state",
    "location"
  ]
}

Response

Authorization link created

authorizeLinkstring required

Link the user follows to authorize their vehicle account

tokenstring nullable

Token identifying the authorization session

providerstring required

Vehicle integration provider that issued the link

authFlowstring required

Authorization flow the client should use to complete linking

Example response

{
  "authorizeLink": "https://link.enode.com/abc123",
  "token": "8c3f0b2e-1a4d-4f7e-9c2b-1d2e3f4a5b6c",
  "provider": "enode",
  "authFlow": "enode-sdk"
}

Changes

    • breaking

      request property / was restricted to a list of enum values

    • info

      added the new all enum value to the request property /

    • info

      added the new charge-state enum value to the request property /

    • info

      added the new control-charging enum value to the request property /

    • info

      added the new location enum value to the request property /