Identify a company using its access token

Purpose: The purpose of this endpoint is to identify a company, by using an access token. To use the access token, you must first generate one.

Below are the steps for generating an access token:

πŸ“˜

PREREQUISITES

You must meet the following requirements for generating an access token:

  1. Create a developer account
  2. Create an application
  3. Create a fleet in Motive

After Motive associates your application to the master fleet, you must generate an access token for your company.

Take the following steps:

Step 1: Trigger the initial OAuth call

  1. Log in to your fleet on the Motive platform.
  2. Paste the following link. Ensure to add your own parameters for the variables.
    1. https://gomotive.com/oauth/authorize?client_id=<YOUR_CLIENT_ID>&redirect_uri=<YOUR_RE
      DIRECT_URI
      >&response_type=<code>&scope=<scopes>
VariableDescription
client_idEnter your client_id that is generated by Motive.
redirect_uriEnter the redirect URI that you enter when creating your company.
response_typeEnter the code of the response type.
scopeSpecify your scopes as required.

The platform will redirect you to the corresponding URL, and prompt you to install the app.

  1. Click Install.
    You will be redirected to the provided URI. The Motive platform will also generate an authorization code and append the same to the URL.
  2. Make a note of the authorization code that is captured by your listener.

Step 2: Generate an access token

  1. Call the following endpoint:
  2. curl -X POST 'https://gomotive.com/oauth/token' -d
    'grant_type=authorization_code&code=<AUTH_CODE>&redirect_uri=<REDIRECT_URI>&client_id=
    <CLIENT_ID>&client_secret=<CLIENT_SECRET>’
    
    Ensure to add the following variables:
VariablesDescription
grant_typeMention the grant type as "authorization_code".
codeSpecify the authroization code that is generated by Motive and capture by your listener.
redirect_uriSpecify the redirect_uri that you mention during the creation of your application.
client_idSpecify your client_id
client_secretSpecify your client_secret

After you make the POST call, you will receive from the platform with the following info:

{
"access_token": "YOUR ACCESS TOKEN",
"token_type": "Bearer",
"expires_in": 7200,
"refresh_token": "YOUR REFRESH TOKEN"
}

Now you have successfully generated your access token.

curl -X POST 'https://gomotive.com/oauth/token' -d
'grant_type=refresh_token&refresh_token=YOUR_REFRESH_TOKEN_HERE&redirect_uri=RE
DIRECT_URI&client_id=CLIENT_ID&client_secret=CLIENT_SECRET’
VariablesDescription
grant_typeSpecify the grant type as refresh_token.
refresh_tokenEnter the refresh token to generate a new access token,
redirect_uriSpecify the redirect_uri that you mention during the creation of your application.
client_idSpecify your client ID.
client_secretSpecify the client secret.

After you generate your access token, you can now use it to confirm the identity of a company.

πŸ‘

Endpoint Header

Mention the access token in the header of the v1/companies endpoint as a Bearer Token in the headers section.


Response Parameters

companies

  • Type: Array of Objects
  • Description: Contains the list of companies.

company

  • Type: Object
  • Description: Details of a single company.

id

  • Type: Integer
  • Description: The unique identifier of the company.

company_id

  • Type: String
  • Description: The system-generated or custom identifier for the company.

name

  • Type: String
  • Description: The name of the company.

street

  • Type: String
  • Description: The street address of the company.

city

  • Type: String
  • Description: The city where the company is located.

state

  • Type: String
  • Description: The state or region where the company is located.

zip

  • Type: String
  • Description: The ZIP or postal code of the company.

dot_ids

  • Type: Array
  • Description: A list of DOT (Department of Transportation) IDs associated with the company.

cycle

  • Type: String
  • Description: The cycle setting used for Hours of Service (HOS) or similar regulations.

time_zone

  • Type: String
  • Description: The time zone the company operates in.

exception_24_hour_restart

  • Type: Boolean
  • Description: Indicates whether the company allows a 24-hour restart exception.

exception_8_hour_break

  • Type: Boolean
  • Description: Indicates whether the company allows an 8-hour break exception.

exception_wait_time

  • Type: Boolean
  • Description: Indicates whether the company applies a wait time exception.

exception_short_haul

  • Type: Boolean
  • Description: Indicates whether the company applies a short haul exception.

exception_ca_farm_school_bus

  • Type: Boolean
  • Description: Indicates whether the company applies the California farm/school bus exception.

exception_adverse_driving

  • Type: Boolean
  • Description: Indicates whether the company allows an adverse driving condition exception.

metric_units

  • Type: Boolean
  • Description: Indicates whether the company uses metric units.

minute_logs

  • Type: Boolean
  • Description: Indicates whether the company uses minute-by-minute logging.

subscription_plan

  • Type: String
  • Description: The subscription plan associated with the company.

Language
Credentials
Header
Click Try It! to start a request and see the response here!