Option 2: User Registration (API)

Full stack of operations with users and users' profiles.

Please make sure you have InstanceID and InstanceKey ready. If not, please refer to the part of account registration

Telematics parameters

User service enables managing user's telematics parameters. It can be set up during registration or changed later via Update User method. This parameters will be used by default if you do not set up them manually.

Parameter

Description

"EnableTracking"

Activate/Deactivate SDK tracking

EnableLogging

Activate/Deactivate debug mode (IMPORTANT: this option causes a greater battery consumption. Use it carefully only while debugging!)

EnableRealtimeLocation

Activate/Deactivate online location monitoring

Enabled

Activate/Deactivate user (Note: deactivated user is not a deleted user. If you need to permanently delete user, use Delete User method)

post
Register a new user

http://user.telematicssdk.com /v1/Registration/Create
Register a new user. The method returns DeviceToken that will be placed to telematics SDK and will play a role of an identifier to link telematics data with app user. Authorization: Allow anonymous
Request
Response
Request
Headers
InstanceID
required
string
//required
InstanceKey
required
string
//required
Response
200: OK
Success
{
"Result": {
"DeviceToken": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"AccessToken": {
"Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1MmU4M2U2ZS00YmQxLTQzNTMtYThjMS02ZGY2YzJhMzJhM2QiLCJqdGkiOiJlZWEwMjlmMS01MGY1LTQyYTMtYTNiOS0zMTgyMGI3YjkxZjIiLCJpYXQiOjE1NzY0MDAzNTcsIkFwcGxpY2F0aW9uSWQiOiIxMDAyIiwiU2RrRW5hYmxlTG9nZ2luZyI6IkZhbHNlIiwiU2RrRW5hYmxlVHJhY2tpbmciOiJUcnVlIiwiU2RrRW5hYmxlUmVhbFRpbWVMb2NhdGlvbiI6IkZhbHNlIiwiU2RrQ2xpZW50SWQiOiIiLCJJbnN0YW5jZUlkIjoiM2MxYzhmZDctNDEzMy00MDRhLTgyZTktOTNhMDE1ZDg1MzYyIiwiSW5zdGFuY2VLZXkiOiIxYjdjYzI1Zi0zMjllLTQ0ODItOWRkMS0wYmIwN2MwYzc5NGIiLCJEZXZpY2VUb2tlbiI6IjUyZTgzZTZlLTRiZDEtNDM1My1hOGMxLTZkZjZjMmEzMmEzZCIsIkNvbXBhbnlJZCI6IjMiLCJSZWZyZXNoVG9rZW5FeHBpcmVkRGF0ZSI6IjIyLjEyLjIwMTkgODo1OTowOSIsIlJlZnJlc2hUb2tlbiI6InhacnN0MjF1SjN6cGw1Mmgybi9wUXM3eUVsYTZ6ZmthcDFWT2hnYUhOUVE9IiwibmJmIjoxNTc2NDAwMzU3LCJleHAiOjE1NzY0MDc1NTcsImlzcyI6IndlYkFwaSIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3Q6NTEzNzQvIn0.5z6eRrKUvI5d0hkjgrOcjPSpCRPsj12uKPkTvKBZ4hI",
"ExpiresIn": 7200
},
"RefreshToken": "xZrst21uJ3zpl52h2n/pQs7yEla6zfkap1VOhgaHNQQ="
},
"Status": 200,
"Title": "",
"Errors": []
}

For transition period we are using Device Token, however it will be replaced with JWT token soon.

Here you can find information about how JWT works: https://jwt.io/introduction/

For the purpose of smooth transition, we recommend you to store JWT token and refresh token together with Device ID. Once we will be ready to move to JWT Token we will inform our clients respectively. Device Token will be supported over 12 month since announcement.

JWT token has a lifetime. After this period - it expires. When your JWT token is expired you should refresh your token.

We will support the old platform till November 01, 2021 and keep inform all our clients about progress and required steps.

Important: JWT Token will be used in other API Requests.

Optionally you can add user information to User Service as well as manage SDK tracking and data collection

Adding user information unlocks better experience working with DataHub. The more information you share, the more completed profile you will get in DataHub, as well as more data for portfolio categorisation.

Request Body
Request Body
{
"CreateAccessToken": true, // default = true, - return jwt token in response for immediately using or use login for receive jwt
"FirstName": "string",
"LastName": "string",
"Nickname": "string",
"Phone": "string",
"Email": "string",
"Gender": "None", // { "None", "Male", "Female", "Other" }
"Birthday": "2019-12-13T06:19:18.837Z",
"MaritalStatus": "string",
"ChildrenCount": 0,
"Country": "string",
"District": "string",
"City": "string",
"Address": "string",
"ImageUrl": "string" // photo url (you can upload your photo later),
"MobileDevice": {
"MobileUid": "string",
"DeviceModel": "string",
"OsType": "android", // { "android" = 0, "iOS" = 1 }
"OsVersion": "string",
"SdkVersion": "string",
"AppVersion": "string",
},
"UserFields": { // default = null. Will be used dafult values below
"EnableTracking": true, // default = true - enable tracking user motion
"EnableLogging": false; // default = false - enable logging on mobile device
"Enabled": true, // default = true - enable sdk
"ClientId": "string", // default = null. User id in your system
}
}

post
Register multiple users

/v1/Registration/CreateMany
Create a bulk of users Authorization: Allow anonymous
Request
Response
Request
Path Parameters
InstanceID
required
string
//required
InstanceKey
required
string
//required
Response
200: OK
{
"Result": {
"Results": [
{
"DeviceToken": "8eedd2d1-e873-4cf4-a641-21f478c9c7a3",
"AccessToken": {
"Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1MmU4M2U2ZS00YmQxLTQzNTMtYThjMS02ZGY2YzJhMzJhM2QiLCJqdGkiOiJlZWEwMjlmMS01MGY1LTQyYTMtYTNiOS0zMTgyMGI3YjkxZjIiLCJpYXQiOjE1NzY0MDAzNTcsIkFwcGxpY2F0aW9uSWQiOiIxMDAyIiwiU2RrRW5hYmxlTG9nZ2luZyI6IkZhbHNlIiwiU2RrRW5hYmxlVHJhY2tpbmciOiJUcnVlIiwiU2RrRW5hYmxlUmVhbFRpbWVMb2NhdGlvbiI6IkZhbHNlIiwiU2RrQ2xpZW50SWQiOiIiLCJJbnN0YW5jZUlkIjoiM2MxYzhmZDctNDEzMy00MDRhLTgyZTktOTNhMDE1ZDg1MzYyIiwiSW5zdGFuY2VLZXkiOiIxYjdjYzI1Zi0zMjllLTQ0ODItOWRkMS0wYmIwN2MwYzc5NGIiLCJEZXZpY2VUb2tlbiI6IjUyZTgzZTZlLTRiZDEtNDM1My1hOGMxLTZkZjZjMmEzMmEzZCIsIkNvbXBhbnlJZCI6IjMiLCJSZWZyZXNoVG9rZW5FeHBpcmVkRGF0ZSI6IjIyLjEyLjIwMTkgODo1OTowOSIsIlJlZnJlc2hUb2tlbiI6InhacnN0MjF1SjN6cGw1Mmgybi9wUXM3e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E9IiwibmJmIjoxNTc2NDAwMzU3LCJleHAiOjE1NzY0MDc1NTcsImlzcyI6IndlYkFwaSIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3Q6NTEzNzQvIn0.5z6eRrKUvI5d0hkjgrOcjPSpCRPsj12uKPkTvKBZ4hI",
"ExpiresIn": 7200
},
"RefreshToken": "lPHZM7PrtiFPdtGn9bhS4H5z8sFRQtmSAD6td6QkXbg="
}
]
},
"Status": 200,
"Title": "",
"Errors": []
}
Request Body
Request Body
{
"Quantity": 0, // required
"CreateAccessToken": true, // default = true
"CustomFields": {
"EnableTracking": true, // default = true
"EnableLogging": false; // default = false
"Enabled": true, // default = true
}
}

Get more information about user management including Tracking activation and deactivation