OAuth 2.0

Motive uses the industry standard OAuth 2.0 protocol for providing the access to its public APIs. This allows the third-party developers to authorize their users by leveraging the OAuth 2.0 protocol.

To use the OAuth 2.0 authorization in your application, you must take the following steps:

  1. Create a developer account with Motive.
  2. Create an application and specify the OAuth 2.0 URI, as well as scopes.

Create a developer account with Motive

  1. Navigate to developer.gomotive.com.

  2. Click Get Started.

  3. On the login page, click Sign Up.

  4. To create your account, enter the following details:

    1. Full Name
    2. Email
    3. Password
    4. Company
  5. Click the "I have read and accepted the Developer Terms of Service and Privacy Policy" checkbox.

  6. Click Sign Up.
    You have now successfully created your developer account in Motive. Now, you can use the same credentials to log in and access the developer portal.

Create an application

  1. Log in to the Motive Developer Portal using your credentials.
  2. Click +Create App.
    The portal will prompt you to enter the name of the app.
  3. Enter the name of the app.
  4. Click Create App.
    The app is now created successfully.
  5. Navigate to the Configuration tab.
  6. Make a note of the Client ID and Client Secret for your company.
  7. Under OAuth 2.0 Integration section, enter the Success Redirect URI.
  8. Under Permissions, enable the following:
    1. Companies
    2. Users
    3. Vehicles
    4. Messages
    5. Fuel Purchases
    6. Groups
    7. Vehicle Gateways (ELD)
    8. Inspections Reports
    9. Fault Codes
    10. Driver Performance Events
    11. HOS
    12. Locations
    13. IFTA reports
    14. Utilization
    15. Documents
    16. Dispatches
    17. Forms
    18. Freight Visibility
  9. Click Save.
    You have now successfully created an application for your organisation.

OAuth Flow

When you create your application, and define the scopes, you must display a button in your application that will initiate the connection process. You must also specify the a redirect_uri, that will navigate the user after connecting to the application.

When the users click the button, they are taken to the below page (sample) where they review the permissions and click Install.

After clicking install the user is redirected to the developer's redirect URI and the authorization code is exchanged for an access token.

📘

NOTE

The TTL for authorization code is 10 minutes. In case, the authorization code is not exchanged for an access token and if the authorization code expires, then the user must re-authorize the application to fetch a new authorization code.