Telematics SDK | Developer portal
  • Get started
  • 4 Steps to Integrate SDK
  • Product Wiki
  • License
  • FAQ
  • PRODUCT DESCRIPTION
    • How it works
    • SDK Features
    • Scoring
      • Risk driving Scoring
        • Event detection
        • Trip rating
        • Overall scoring
      • Eco Scoring
    • Dataset
      • Dataset | User statistics API
      • Data samples
        • Summary - Processed track details (Rich track details)
        • Processed track waypoints (Rich track points)
        • Summary - list of Processed tracks
        • Incoming track events
        • Incoming track points (waypoints)
        • Summary - list of Incoming tracks
      • Dataset Decription
        • Bluetooth OBD - Vehicle Dataset
        • LastKnownPoints
        • IncomingTrackPoints
        • IncomingTrackEvents
        • Enriched telematics data
          • RichTracks
          • RichTrackPoints
          • RichTrackEvents
          • RichTrackDetails
          • UserStatisticDrivingDetails
        • Raw telematics data from SDK
    • Reporting
      • Drivecoins summary
      • Trip summary
      • Scoring summary
      • User state
      • Fraud
      • Trip waypoints
      • Trip events
    • External Articles
      • Why mobile telematics hits hardware telematics
  • Step 1: Create Datahub Account
  • Step 2: SDK Installation
    • Get started
    • iOS SDK installation
      • *Set up Your Development Environment
      • *Configure Your Project
      • *App Delegate
      • *Configure Framework
      • *React Native Installation
        • Create the iOS bridge
      • Add list of trips to your ViewController
      • Add statistics data to your ViewController
      • *What’s different in iOS 13?
      • *iOS 13 Permissions Wizard
      • *SDK Enable \ Disable \ Disable With Upload
      • *Incoming Tags
      • *Tracking Status
      • *SDK Delegates
      • *SDK Modes
      • *Using the Debugging Tools in Simulator
    • Android SDK installation
      • *Getting started
        • *Set up Your Development Environment
        • *Setup and enable SDK
        • *Permissions wizard
        • *Permissions dialog
        • *Configure SDK variables for notifications
      • *Subscribe to tracking events
      • *Incoming tags managing
      • *Migration from SDK v1.6.x to SDK v2.0.x
    • *Check SDK Installation
      • iOS Simulator
      • DataTool
      • ZenRoad
    • *Demo Applications
      • iOS | Open Source Demo Application
      • iOS | SDK Demo Application
      • iOS | Swift | SDK Demo Application
      • Android | SDK Demo Application
      • Android | Java | SDK Demo Application
      • Flutter | SDK Demo Application
    • SDK Changelog
      • Android SDK Changelog
      • iOS SDK Changelog
    • Permissions Guides
      • First Launch
        • iOS 13 (and higher) Permissions Guide
        • iOS 12 (and lower) Permissions Guide
        • Android 9 Permissions Guide
        • Android 9 XIaomi Permissions Guide
        • Android 10 Permissions Guide
      • *Troubleshooting
        • iOS — Troubleshooting
          • iOS — Troubleshooting
        • Android — Troubleshooting
          • Samsung — Troubleshooting
          • Oppo — Troubleshooting
          • Huawei — Troubleshooting
          • Xiaomi — Troubleshotting
          • OnePlus — Troubleshooting
          • Meizu — Troubleshooting
          • Asus — Troubleshooting
          • Vivo — Troubleshooting
          • Wiko — Troubleshooting
  • Step 3: Register SDK users
    • User Registration (API)
  • Step 4: API | User Statistics, Scores, Trips
    • Step 4: Get Statistics, Scorings and Trip Data
    • API Authorization
    • Statistics and Scoring APIs
      • Get started - Statistics and Scoring API
      • User | Individual Scorings and Statistics
      • Admin | User(s) - Scorings and Statistics
      • Admin | Consolidated Scorings and Statistics
    • Trips API
      • Get a short list of tracks
      • Get a list of tracks with paging
      • Get a list of tracks by IDs
      • Get a single track with waypoints
      • Get the most earliest track
      • Track Statuses
  • SDK Features
    • *Bluetooth Device - Get started
      • *Get Started
      • *Android - ELM API
      • *iOS - ELM API
    • Trip Tags - Get started
      • Tags for trips via mobile app
        • Android - Tags for trips
        • iOS - Tags for trips
      • Tags for period
      • Trip log by tags
  • PLATFORM FEATURES
    • *User Management
      • *User Registration
      • *Check User Existence
      • *User Management
    • *Vehicle Management
      • *Directories
      • *Vehicles
    • FNOL, Inspections & Damage Recognition
      • Get started
      • Profiles
      • Claims
      • Vehicle inspections
        • Dictionary of vehicle photos
      • Photo processing
    • *Leaderboard
      • *Summary Leaderboard
      • *Leaderboard by factors
      • Swagger - Leaderboard
    • *Streaks
    • *SNS
      • *How to register AWS SNS
    • 3rd party data processing
      • Swagger - Incoming getaway
    • *User & Permissions Status | Heartbeats
  • Other
    • Response Codes
    • Resources swaggers
      • Swagger: User service
      • Swagger: Scorings and Statistics API
      • Swagger: Telematics data
      • Swagger: Leaderboard
      • Swagger: Vehicle Management
      • Driving details
      • Swagger: FNOL, Inspections & Damage Recognition
      • Swagger: Heartbeats
    • Archive
      • Get started
      • Statistics and Scorings API
      • Step 5: Get statistics and trip data [ARCHIVED]
      • User Statistics API [Archived]
      • SDK - Statistics API [ARCHIVED]
        • Get the data to the Android app
          • Android Telematics data (Tracks)
            • Check current running track state
            • Get start date for current recording trip
            • Register tracking state listener (for onStartTracking/onStopTracking events)
            • Register speed violations listener
            • Get flag for registered speed violations listener
            • Get registered speed limit in km/h or default
            • Get registered speed violations timeout in ms or default
            • Get Tracks
            • Get detailed trips information
            • Get available user roles
            • Change a user role (any of TrackOriginDictionary.code)
          • Android User Statistics
            • Get Dashboard info
            • Get detailed Dashboard
            • Get Driving time statistics
            • Get Speeding statistics
            • Get Mileage statistics
            • Get Distracted Phone Usage statistics
        • Get the data to the iOS app
          • Other methods
          • iOS Telematics data (tracks)
            • Request all Tracks with specified offset and limit
            • Request all Tracks with specified offset and limit. No filter will be used in request
            • Request Track info with specified Track Token
            • Request Track origins dictionary
            • Change Track Origin Code
            • Share Track
          • iOS User Statistics
            • Get shared Track
            • Request main statistics data for all possible statistic types
            • NS_ENUM
            • Request main statistics data for all possible statistic types
            • Properties and Protocols
      • Get all DeviceTokens
    • Report a bug
    • Data Hub
    • Talk to sales
  • Postman collection
Powered by GitBook
On this page
  • Authorization Types
  • API Authorization Credentials
  • Authorization
  • Format of body request
  • curl Request:
  • Authorization via Swagger
  • Login
  • Autorization

Was this helpful?

  1. Step 4: API | User Statistics, Scores, Trips

API Authorization

Get access to Telematics API

PreviousStep 4: Get Statistics, Scorings and Trip DataNextStatistics and Scoring APIs

Last updated 4 years ago

Was this helpful?

Authorization methods are located in User-service.

VERY IMPORTANT! Read it carefully:

Almost all responses contain DeviceToken, AccessToken and RefreshToken. We are currently in transition period of moving to a new platform. The existing platform already operates both with DeviceToken and AccessToken. We strongly recommend to store all three tokens to smoothly switch between platforms in the nearest future. After registration you will receive accessToken with JWT and refreshToken. Use JWT token for user's authorized requests. JWT token has a lifetime. After this period - it expires. When your JWT token is expired you should refresh your token. Here you can find information about how JWT works: We will support the old platform till November 01, 2021 and keep inform all our clients about progress and required steps.

To get and manage data of individual user you need to authorize with user's deviceToken (or JWT token in some cases), user's InstanceID and InstanceKey. To get and manage consolidated and accumulated data of user groups and all other users separately from your back-end, you need to authorize in API as admin with API Authorization Credentials.

Authorization Types

API Services with authorization required

Authorization type

How to authorize in API

Authorize as User

InstanceID: User Group InstanceID

Login: User DeviceToken

Password: User Group InstanceKEY

Authorize as Admin with API Authorization Credentials

InstanceID: API InstanceID

Login: API Login

Password: API Password

API Authorization Credentials

Please, follow to your Management page in DataHub and generate API Authorization Credentials. Use provided credentials to get access to API. If you do not have access to Management page - please, ask your colleague with a Company Access to DataHub to provide you with these credentials.

Authorization

POST https://user.telematicssdk.com/v1/Auth/Login

The method allows to log into API and get access to sensitive information Authorization: Allow Anonymous

Headers

Name
Type
Description

InstanceID

string

User Group Instance ID or API Instance ID

Request Body

Name
Type
Description

LoginFields

string

User deviceToken or API Login

Password

string

User group Instance Key or API Password

{
  "Result": {
    "DeviceToken": "String",
    "AccessToken": {
      "Token": "String",
      "ExpiresIn": 1209600 // milliseconds
    },
    "RefreshToken": "String"
  },
  "Status": 200,
  "Title": "",
  "Errors": []
}

Format of body request

Authorize as user

{
  "LoginFields": {deviceToken: "deviceToken"},
  "Password": "InstanceKEY"
}

Authorize as Admin with API Authorisation Credentials

Authorize as Admin with API Authorization Credentials
{
  "loginFields": {"Email":"4DED@auth.me"},
  "password": "Password"
}

curl Request:

curl -X POST “
https://user.telematicssdk.com/v1/Auth/Login”
 -H “accept: /” -H “InstanceId: “String” -H “InstanceKey: “String” -H “Content-Type: application/json-patch+json” -d “{\“loginFields\“:{\“Email\“:\“myemail@mydomain.com\“},\“password\“:\“P@ssword\“}”

Once you Log in and get credentials for further actions you have to be authorized. Please use Open Auth authorization.

Use "Authorization": "Bearer {Token}" // required in header for any method when authorization required. {Token} - the JWT token that you get in /v1/Auth/Login response method.

Please be informed, that the accesstoken expires every 2 hours. You have to update it every 2 hours using refresh token and method POST /v1/Auth/RefreshToken

We recommend keeping both AccessToken and Refresh token and set a schedule to refresh AccessToken to get seamless access to telematics platform, APIs and services

Authorization via Swagger

Login

Request

Please have API's InstanceID ready

Response

{
  "Result": {
    "DeviceToken": "String",
    "AccessToken": {
      "Token": "String",
      "ExpiresIn": 1209600
    },
    "RefreshToken": "String"
  },
  "Status": 200,
  "Title": "",
  "Errors": []
}

Autorization

Please add Bearer JWT to authorization form.

Make sure you used a proper format value.

Example of format

Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiOTA5MDNkZi1iOWExLTQ3MzQtOWI1Yi02MDJkZGFiNmYwNmUiLCJqdGkiOiIzOGEyZmZmNi1kNmVkLTRjZGItOTRjMi1mOTk5NzIzYWUyYzMiLCJpYXQiOjE1ODQ0NTQ1MDcsIkFwcGxpY2F0aW9uSWQiOiIyMSIsIkRhdGFIdWJFbWFpbCI6ImFuZHJpeS50dXBjaGllbmtvQHJheGVsdGVsZW1hdGljcy5jb20iLCJJbnN0YW5jZUlkIjoiYThlN2I3M2YtNTA4Yi00OWNlLWFmNTItNGMwZTYwNzAxMTM2IiwiSW5zdGFuY2VLZXkiOiI2MjY5N2RiNi0xZjA1LTRlYmMtOTYzMC1iODg3MmIxNDJlMTIiLCJEZXZpY2VUb2tlbiI6ImI5MDkwM2RmLWI5YTEtNDczNC05YjViLTYwMmRkYWI2ZjA2ZSIsIkNvbXBhbnlJZCI6IjM5IiwiSXNEYXRhSHViVXNlciI6IlRydWUiLCJuYmYiOjE1ODQ0NTQ1MDcsImV4cCI6MTU4NTY2NDEwNywiaXNzIjoid2ViQXBpIiwiYXVkIjoiaHR0cDovL2xvY2FsaG9zdDo1MTM3NCJ9.Cy2c_FowBg4Ts1aPsKILn5-uI8NcY9dVIB4w9f8a8rY

For security purpose the API will accept any value with no error message. However, if you use incorrect value, you won't be able to get information from sensitive API.

by a single user or a list of users in a single User Group (InstanceID)

by a single User Group (InstanceID)

by a single user or a list of users in a single User Group (InstanceID)

(User(s) Permissions status)

curl -X POST “ -H “accept: /” -H “InstanceId: “String” -H “InstanceKey: “String” -H “Content-Type: application/json-patch+json” -d “{\“loginFields\“:{\“Email\“:\“myemail@mydomain.com\“},\“password\“:\“P@ssword\“}”

Swagger:

https://user.telematicssdk.com/v1/Auth/Login”
https://user.telematicssdk.com/swagger/index.html
Individual user Statistics and Scorings API
Individual user's Streaks
User Management API
Accumulated Statistics and Scorings API
Consolidated Statistics and Scorings API
Accumulated Streaks
Heartbeats
https://jwt.io/introduction/
API Authorization Credentials