Onboarding Service The onboarding service configures the system and the device according to the vehicle it is installed in.
The device embeds a complex operating system - Morpheus - that needs to be configured according to some of the vehicle specifications and information on how it was physically installed in order to be able to perform to the max .
The onboarding service is here to gather all of this information and then ensure that the device is correctly configured .
Onboarding is fully asynchronousA device can be installed in a vehicle before the onboarding is done A device and a vehicle can be onboarded together before the device has been physically installed The service also offers:
Entitlement management for fleet operators to access the device, vehicle and optionally the driver’s dataOptional Collection of the driver’s consent Optional Collection of the consent scope Collection of the vehicle state of health or configuration when the installation is performedOffboarding that will free the device for re-use (end of service, vehicle sold…)Update if the vehicle or installation specifics have errors and need to be updatedPrerequisites Before you begin, make sure you have:
Signed up at connect.munic.io . Set up a fleet Access to a device to onboard with the vehicle Access to the information for the vehicle you want to onboard User stories In this documentation, we will detail the following user stories :
Check your distributor ID Manage fleet ticketsHow to Create an onboarding ticket for the fleet List all the tickets already created Onboard a device and a vehicle for a specific fleetCreate a new onboarding Select the device for this onboarding Select the vehicle for this onboarding Provide the vehicle details during the onboarding Optional Select the owner and get the initial consentOptional Consent scope selectionProvide device vehicle installation information Finalize the onboarding Find an onboarding for a specific vehicle or device Offboard an onboarding that has been finalized Cancel an onboarding in progress List historical onboardings for a device or a vehicle Get my account identifier (uid) Get all visible groups and choose the corresponding group id (results are based on what your token gives you access to) using the groups query Get the device’s owner id using the device query Use the Distributors query to get the distributor’s id (results are based on what your token has access to) Decode the vin to find a reference and meta-data on the specified vin and return its id (model_id) for use during the next steps List my visible resources
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"""
Variables:
{
"pageSize": 20,
"pageId": "1",
"vin": "JM1BL1S60A1164559",
"region": "europe",
"kba": null
}
"""
query fleetInformation (
$pageSize: Int ,
$pageId: ID ,
$vin: String !,
$region: String ,
$kba: ID
) {
me: account {
id
email
}
groups(
pageSize: $pageSize,
pageId : $pageId
) {
next
count
list {
ID
label
}
}
devices(
pageSize: $pageSize,
pageId : $pageId
) {
next
count
list {
ID
serial_number
}
}
distributors(
pageSize: $pageSize,
pageId : $pageId
){
next
count
list {
ID
label
}
}
models: decodeVin (
vin: $vin,
region : $region,
kba : $kba
) {
ID
yearOfFirstCirculation
kba
advancedModel
manufacturer
country
model
modelCode
modelVersionCode
vehicleType
engineFuelType
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "query fleetInformation(\n $pageSize: Int,\n $pageId: ID,\n $vin: String!,\n $region: String,\n $kba: ID\n) {\n me: account {\n id\n email\n }\n\n groups(\n pageSize: $pageSize,\n pageId: $pageId\n ) {\n next\n count\n list {\n ID\n label\n }\n }\n\n devices(\n pageSize: $pageSize,\n pageId: $pageId\n ) {\n next\n count\n list {\n ID\n serial_number\n }\n }\n\n distributors(\n pageSize: $pageSize,\n pageId: $pageId \n ){\n next\n count\n list {\n ID\n label\n }\n }\n\n models: decodeVin(\n vin: $vin,\n region: $region,\n kba: $kba\n ) {\n ID\n yearOfFirstCirculation\n kba\n advancedModel\n manufacturer\n country\n model\n modelCode\n modelVersionCode\n vehicleType\n engineFuelType\n }\n}", "variables":{ "pageSize": 20, "pageId": "1", "vin": "JM1BL1S60A1164559", "region": "europe", "kba": null}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "query fleetInformation(
$pageSize: Int,
$pageId: ID,
$vin: String!,
$region: String,
$kba: ID
) {
me: account {
id
email
}
groups(
pageSize: $pageSize,
pageId: $pageId
) {
next
count
list {
ID
label
}
}
devices(
pageSize: $pageSize,
pageId: $pageId
) {
next
count
list {
ID
serial_number
}
}
distributors(
pageSize: $pageSize,
pageId: $pageId
){
next
count
list {
ID
label
}
}
models: decodeVin(
vin: $vin,
region: $region,
kba: $kba
) {
ID
yearOfFirstCirculation
kba
advancedModel
manufacturer
country
model
modelCode
modelVersionCode
vehicleType
engineFuelType
}
}", "variables":
{
"pageSize": 20,
"pageId": "1",
"vin": "JM1BL1S60A1164559",
"region": "europe",
"kba": null
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"devices" : {
"count" : 2 ,
"list" : [
{
"ID" : "DEMO-DEVICE-001" ,
"serial_number" : "DEMO-DEVICE-001"
},
{
"ID" : "DEMO-DEVICE-002" ,
"serial_number" : "DEMO-DEVICE-002"
}
],
"next" : null
},
"distributors" : {
"count" : 1 ,
"list" : [
{
"ID" : "886049150514954248" ,
"label" : "CloudDemo"
}
],
"next" : null
},
"groups" : {
"count" : 3 ,
"list" : [
{
"ID" : "886051898430980108" ,
"label" : "CloudTest_distributor"
},
{
"ID" : "886052101756059660" ,
"label" : "CloudTest_client"
},
{
"ID" : "886052333836959756" ,
"label" : "CloudTest_center"
}
],
"next" : null
},
"me" : {
"email" : "cloud.onboarding.test@gmail.fr" ,
"id" : "31c925df-a185-4d64-9976-5eb0e669bd37"
},
"models" : [
{
"ID" : "1082122" ,
"advancedModel" : "1.6 16V (1.6 MZR (BL14))" ,
"country" : null ,
"engineFuelType" : "GASOLINE" ,
"kba" : null ,
"manufacturer" : null ,
"model" : "3 (BL)" ,
"modelCode" : null ,
"modelVersionCode" : null ,
"vehicleType" : null ,
"yearOfFirstCirculation" : 2008
},
{
"ID" : "1082123" ,
"advancedModel" : "1.6 16V (1.6 MZR)" ,
"country" : null ,
"engineFuelType" : "GASOLINE" ,
"kba" : null ,
"manufacturer" : null ,
"model" : "3 (BL)" ,
"modelCode" : null ,
"modelVersionCode" : null ,
"vehicleType" : null ,
"yearOfFirstCirculation" : 2010
}
]
}
} Now you are all set, let’s move on to the onboarding_create mutation using all the variables collected during this process and get the “id” field from the response for our next step.
NotePlease note that yous must specify the region for the decodeVin part. The region should be one of the following:
africa asia europe north america south america oceania Manage fleet tickets Create an onboarding ticket for the fleet This is the process of creating a code that is an identifier that will be used to associate the onboarding process to a certain group, in this case the code will be generated for onboarding the customer’s devices to the proper customer group. The code or ID generated is the first step that will allow the following steps to continue when using the onboarding APIs. A default account should be specified corresponding to the vehicle owner.
Variables used in this mutation:
number_of_onboardings client_reference: client’s group ou project identifier client_reference_type: GROUP ou PROJECT default_account_id: device’s owner id default_whitelisted_data: data categories Create client identification
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
Variables:
{
"client_reference":"886052333836959756",
"default_account_id":"31c925df-a185-4d64-9976-5eb0e669bd37"
}
"""
mutation CreateIdentificationTicket (
$client_reference: ID ,
$default_account_id: ID
) {
client_identification_create(
client_reference: $client_reference
client_reference_type : GROUP
default_account_id: $default_account_id
default_whitelisted_data :[POSITION , SIM_IDENTIFICATION, VEHICLE_IDENTIFICATION]
number_of_onboardings:100
) {
code
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "mutation CreateIdentificationTicket(\n $client_reference: ID, \n $default_account_id: ID\n) {\n client_identification_create(\n client_reference: $client_reference\n client_reference_type: GROUP\n default_account_id: $default_account_id\n default_whitelisted_data:[POSITION, SIM_IDENTIFICATION, VEHICLE_IDENTIFICATION]\n number_of_onboardings:100\n ) {\n code\n }\n}", "variables":{ "client_reference":"886052333836959756", "default_account_id":"31c925df-a185-4d64-9976-5eb0e669bd37"}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "mutation CreateIdentificationTicket(
$client_reference: ID,
$default_account_id: ID
) {
client_identification_create(
client_reference: $client_reference
client_reference_type: GROUP
default_account_id: $default_account_id
default_whitelisted_data:[POSITION, SIM_IDENTIFICATION, VEHICLE_IDENTIFICATION]
number_of_onboardings:100
) {
code
}
}", "variables":
{
"client_reference":"886052333836959756",
"default_account_id":"31c925df-a185-4d64-9976-5eb0e669bd37"
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"client_identification_create" : {
"code" : "9KZhYSsKk"
}
}
} See More
List available ticket for the fleet List available client identification
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Variables:
{
"pageSize": 20,
"pageId": "1"
}
"""
query clientIdentifications (
$pageSize: Int ,
$pageId: ID
) {
clientIdentifications(
pageSize: $pageSize,
pageId : $pageId
) {
next
count
list {
code
clientReference
clientReferenceType
defaultAccount {
ID
email
}
numberOfOnboardings
numberOfStartedOnboardings
}
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "query clientIdentifications(\n $pageSize: Int,\n $pageId: ID\n) {\n clientIdentifications(\n pageSize: $pageSize,\n pageId: $pageId\n ) {\n next\n count\n list {\n code\n clientReference\n clientReferenceType\n defaultAccount {\n ID\n email\n }\n numberOfOnboardings\n numberOfStartedOnboardings\n }\n }\n}", "variables":{ "pageSize": 20, "pageId": "1"}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "query clientIdentifications(
$pageSize: Int,
$pageId: ID
) {
clientIdentifications(
pageSize: $pageSize,
pageId: $pageId
) {
next
count
list {
code
clientReference
clientReferenceType
defaultAccount {
ID
email
}
numberOfOnboardings
numberOfStartedOnboardings
}
}
}", "variables":
{
"pageSize": 20,
"pageId": "1"
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"clientIdentifications" : {
"count" : 2 ,
"list" : [
{
"clientReference" : "886052333836959756" ,
"clientReferenceType" : "GROUP" ,
"code" : "aCtdN7ZMh" ,
"defaultAccount" : {
"ID" : "31c925df-a185-4d64-9976-5eb0e669bd37" ,
"email" : "cloud.onboarding.test@gmail.fr"
},
"numberOfOnboardings" : 100 ,
"numberOfStartedOnboardings" : 0
},
{
"clientReference" : "886052333836959756" ,
"clientReferenceType" : "GROUP" ,
"code" : "olw5H/Wyr" ,
"defaultAccount" : {
"ID" : "31c925df-a185-4d64-9976-5eb0e669bd37" ,
"email" : "cloud.onboarding.test@gmail.fr"
},
"numberOfOnboardings" : 100 ,
"numberOfStartedOnboardings" : 0
}
],
"next" : null
}
}
} See More
Onboarding a vehicle The following documentation lists the different requests required to perform the onboarding process for a customer’s devices, the main objective of the Onboarding process is to:
Create a vehicle (with enriched data) on the ekko backend in order to apply the appropriate configuration on the device Associate a dongle with a vehicle after having it declared or “reserved” on the ekko backend Add additional device-vehicle entities to the project group which will activate the MUNIC services on which the group is subscribed Maintain traceability of the vehicle-device entity which will also allow other services to recognize this coupling and to have it visible to the user Allow flexibility with regards to the evolution of products, applying changes dynamically in response to the new requirements Create a new onboarding This will generate an onboarding session using the ticket code. Variables used in this mutation:
distributor_id code: the result of the first mutation Create Onboarding Request
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
Variables:
{
"distributorId": "886049150514954248",
"code": "9KZhYSsKk"
}
"""
mutation CreateOnboardingRequest (
$distributorId: ID !,
$code: String
) {
on boardingCreate(
distributorId: $distributorId,
code : $code
) {
id
status
withCode
createdAt
updatedAt
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "mutation CreateOnboardingRequest(\n $distributorId: ID!, \n $code: String\n) {\n onboardingCreate(\n distributorId: $distributorId,\n code: $code\n ) {\n id\n status\n withCode\n createdAt\n updatedAt\n }\n}", "variables":{ "distributorId": "886049150514954248", "code": "9KZhYSsKk"}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "mutation CreateOnboardingRequest(
$distributorId: ID!,
$code: String
) {
onboardingCreate(
distributorId: $distributorId,
code: $code
) {
id
status
withCode
createdAt
updatedAt
}
}", "variables":
{
"distributorId": "886049150514954248",
"code": "9KZhYSsKk"
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"onboardingCreate" : {
"createdAt" : "2023-07-28T09:32:59.698Z" ,
"id" : "886264233019080716" ,
"status" : "OPEN" ,
"updatedAt" : "2023-07-28T09:32:59.698Z" ,
"withCode" : true
}
}
} See More
Claiming a device This will reserve the device that will be used during the onboarding. Variables used in this mutation:
requestId: the onboarding id from the previous step deviceId: device imei serial number Claiming a device Request
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
Variables:
{
"requestId": "886264233019080716",
"deviceId": "DEMO-DEVICE-001",
"serialNumber": "DEMO-DEVICE-00"
}
"""
mutation onboardingDeviceReserve (
$requestId: ID !,
$deviceId: ID ,
$serialNumber: String
) {
device: onboardingDeviceReserve (
id: $requestId,
deviceId : $deviceId,
serialNumber : $serialNumber
) {
deviceOnboardingId : ID
serialNumber
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "mutation onboardingDeviceReserve(\n $requestId: ID!,\n $deviceId: ID,\n $serialNumber: String\n) {\n device: onboardingDeviceReserve(\n id: $requestId,\n deviceId: $deviceId,\n serialNumber: $serialNumber\n ) {\n deviceOnboardingId: ID\n serialNumber\n }\n}", "variables":{ "requestId": "886264233019080716", "deviceId": "DEMO-DEVICE-001", "serialNumber": "DEMO-DEVICE-00"}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "mutation onboardingDeviceReserve(
$requestId: ID!,
$deviceId: ID,
$serialNumber: String
) {
device: onboardingDeviceReserve(
id: $requestId,
deviceId: $deviceId,
serialNumber: $serialNumber
) {
deviceOnboardingId: ID
serialNumber
}
}", "variables":
{
"requestId": "886264233019080716",
"deviceId": "DEMO-DEVICE-001",
"serialNumber": "DEMO-DEVICE-00"
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"device" : {
"deviceOnboardingId" : "886275077724897292" ,
"serialNumber" : "DEMO-DEVICE-001"
}
}
} Create a vehicle This will create the vehicle. If the vehicle already exists, the query will return an error because a VIN already exists for this vehicle. In that case you can delete the vehicle with a delete vehicle mutation, once done, retry the above mutation.
Create a vehicle Request
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""
Variables:
{
"requestId": "886264233019080716",
"plateNumber": "HEM7038",
"vin": "JM1BL1S60A1164559"
}
"""
mutation onboardingVehicleCreate (
$requestId: ID !,
$plateNumber: String ,
$vin: String
) {
vehicleOnboardingId: onboardingVehicleCreate (
id: $requestId,
plateNumber : $plateNumber,
vin : $vin
)
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "mutation onboardingVehicleCreate(\n $requestId: ID!,\n $plateNumber: String,\n $vin: String\n) {\n vehicleOnboardingId: onboardingVehicleCreate(\n id: $requestId,\n plateNumber: $plateNumber,\n vin: $vin\n )\n}", "variables":{ "requestId": "886264233019080716", "plateNumber": "HEM7038", "vin": "JM1BL1S60A1164559"}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "mutation onboardingVehicleCreate(
$requestId: ID!,
$plateNumber: String,
$vin: String
) {
vehicleOnboardingId: onboardingVehicleCreate(
id: $requestId,
plateNumber: $plateNumber,
vin: $vin
)
}", "variables":
{
"requestId": "886264233019080716",
"plateNumber": "HEM7038",
"vin": "JM1BL1S60A1164559"
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"device" : {
"deviceOnboardingId" : "886275077724897292" ,
"serialNumber" : "DEMO-DEVICE-001"
}
}
} See More
This will allow you to add user information and the reference from the decode vin request. Some services require extra information for the vehicle to get enhanced features,
Add Vehicle Information Request
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
Variables:
{
"requestId": "886264233019080716",
"kba": "-1",
"modelId": "-1"
}
"""
mutation onboardingVehicleEnrichment (
$requestId: ID !,
$kba: ID ,
$modelId: ID
) {
on boardingVehicleEnrichment(
id: $requestId,
kba : $kba,
modelId : $modelId
) {
modelId
kba
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "mutation onboardingVehicleEnrichment(\n $requestId: ID!,\n $kba: ID,\n $modelId: ID\n) {\n onboardingVehicleEnrichment(\n id: $requestId,\n kba: $kba,\n modelId: $modelId\n ) {\n modelId\n kba\n }\n}", "variables":{ "requestId": "886264233019080716", "kba": "-1", "modelId": "-1"}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "mutation onboardingVehicleEnrichment(
$requestId: ID!,
$kba: ID,
$modelId: ID
) {
onboardingVehicleEnrichment(
id: $requestId,
kba: $kba,
modelId: $modelId
) {
modelId
kba
}
}", "variables":
{
"requestId": "886264233019080716",
"kba": "-1",
"modelId": "-1"
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"onboardingVehicleEnrichment" : {
"kba" : "-1" ,
"modelId" : "-1"
}
}
} See More
This information is needed to configure your device correctly.
Add Installation Information Request
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Variables:
{
"requestId": "886264233019080716",
"connectionType": "CABLE",
"kmAtInstallation": 123,
"activateReadWriteInDevice": true,
"deviceMode": "TELEMATIC"
}
"""
mutation onboardingVehicleConnectionUpdate (
$id: ID !,
$vehicleConnectionId: ID ,
$connectionType: DeviceConnectionType ,
$kmAtInstallation: Int ,
$activateReadWriteInDevice: Boolean ,
$deviceMode: ProfileDeviceModeClassArg
) {
on boardingVehicleConnectionUpdate(
id: $id,
vehicleConnectionId : $vehicleConnectionId,
connectionType : $connectionType,
kmAtInstallation : $kmAtInstallation,
activateReadWriteInDevice : $activateReadWriteInDevice,
deviceMode : $deviceMode
) {
id
activateReadWriteInDevice
connectionType
deviceMode
kmAtInstallation
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "mutation onboardingVehicleConnectionUpdate(\n $id: ID!,\n $vehicleConnectionId: ID,\n $connectionType: DeviceConnectionType,\n $kmAtInstallation: Int,\n $activateReadWriteInDevice: Boolean,\n $deviceMode: ProfileDeviceModeClassArg\n) {\n onboardingVehicleConnectionUpdate(\n id: $id,\n vehicleConnectionId: $vehicleConnectionId,\n connectionType: $connectionType,\n kmAtInstallation: $kmAtInstallation,\n activateReadWriteInDevice: $activateReadWriteInDevice,\n deviceMode: $deviceMode\n ) {\n id\n activateReadWriteInDevice\n connectionType\n deviceMode\n kmAtInstallation\n }\n}", "variables":{ "requestId": "886264233019080716", "connectionType": "CABLE", "kmAtInstallation": 123, "activateReadWriteInDevice": true, "deviceMode": "TELEMATIC"}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "mutation onboardingVehicleConnectionUpdate(
$id: ID!,
$vehicleConnectionId: ID,
$connectionType: DeviceConnectionType,
$kmAtInstallation: Int,
$activateReadWriteInDevice: Boolean,
$deviceMode: ProfileDeviceModeClassArg
) {
onboardingVehicleConnectionUpdate(
id: $id,
vehicleConnectionId: $vehicleConnectionId,
connectionType: $connectionType,
kmAtInstallation: $kmAtInstallation,
activateReadWriteInDevice: $activateReadWriteInDevice,
deviceMode: $deviceMode
) {
id
activateReadWriteInDevice
connectionType
deviceMode
kmAtInstallation
}
}", "variables":
{
"requestId": "886264233019080716",
"connectionType": "CABLE",
"kmAtInstallation": 123,
"activateReadWriteInDevice": true,
"deviceMode": "TELEMATIC"
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"onboardingVehicleId" : "886272770781118472"
}
} Important note:
Regarding the connection type, you have four type of possibilities:
CABLE - meant for support, to know if an extension cable is used
DIRECT - device is plugged directly on the OBD Port
FIAT_CABLE - In case you have a device with 4 Mux and a cable that redirects the PIN, to support vehicles that have OEM informations on PIN 1,9 (per default all vehicles are on 3/8, 3/11 or 1). There is no need to use this cable if you have a 6 MUX device.
PANIC_CABLE - You need to have a panic cable connected to the device. The field which will report that a PANIC_CABLE button is pressed is MDI_DIO_PANIC_BUTTON - Panic button state, true when the panic button was pressed.
Driver consent Optional if default consent is set in the onboarding ticket
Add Driver Consent
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
Variables:
{
"requestId": "886264233019080716",
"whitelistedData": ["POSITION", "VEHICLE_IDENTIFICATION", "SIM_IDENTIFICATION"]
}
"""
mutation onboardingConsent (
$requestId: ID !,
$whitelistedData: [OnboardingWhitelistedDataInput !]!
) {
on boardingConsent(
id: $requestId,
whitelistedData : $whitelistedData
) {
consentId : id
whitelistedData
inherited
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "mutation onboardingConsent(\n $requestId: ID!,\n $whitelistedData: [OnboardingWhitelistedDataInput!]!\n) {\n onboardingConsent(\n id: $requestId,\n whitelistedData: $whitelistedData\n ) {\n consentId: id\n whitelistedData\n inherited\n }\n}", "variables":{ "requestId": "886264233019080716", "whitelistedData": ["POSITION", "VEHICLE_IDENTIFICATION", "SIM_IDENTIFICATION"]}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "mutation onboardingConsent(
$requestId: ID!,
$whitelistedData: [OnboardingWhitelistedDataInput!]!
) {
onboardingConsent(
id: $requestId,
whitelistedData: $whitelistedData
) {
consentId: id
whitelistedData
inherited
}
}", "variables":
{
"requestId": "886264233019080716",
"whitelistedData": ["POSITION", "VEHICLE_IDENTIFICATION", "SIM_IDENTIFICATION"]
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"onboardingConsent" : {
"consentId" : "886281754993655820" ,
"inherited" : false ,
"whitelistedData" : [
"POSITION" ,
"VEHICLE_IDENTIFICATION" ,
"SIM_IDENTIFICATION"
]
}
}
} Finalize the onboarding This will explicitly close the onboarding process, and launch a campaign to configure the device based on the onboarding information.
Finalize onboarding
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""
Variables:
{
"requestId": "886264233019080716",
}
"""
mutation onboardingFinalize (
$requestId: ID !
) {
request: onboardingFinalize (
id: $requestId
) {
onboardingRequestId : id
status
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "mutation onboardingFinalize(\n $requestId: ID!\n) {\n request: onboardingFinalize(\n id: $requestId\n ) {\n onboardingRequestId: id\n status\n }\n}", "variables":{ "requestId": "886264233019080716",}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "mutation onboardingFinalize(
$requestId: ID!
) {
request: onboardingFinalize(
id: $requestId
) {
onboardingRequestId: id
status
}
}", "variables":
{
"requestId": "886264233019080716",
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"request" : {
"onboardingRequestId" : "886264233019080716" ,
"status" : "CLOSED"
}
}
} Operation on onboarding requests List onboardings Finalize onboarding requests
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""
Variables:
{
"pageSize": 20,
"pageId": "1"
}
"""
query fleetInformation (
$pageSize: Int ,
$pageId: ID
) {
on boardings(
pageSize: $pageSize,
pageId : $pageId
) {
next
count
list {
ID
status
connectionType
kmAtInstallation
activateReadWriteInDevice
device {
id
serial_number
}
vehicle {
id
vin
plate
}
driver {
id
email
}
consent {
id
whitelistedData
inherited
}
}
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "query fleetInformation(\n $pageSize: Int,\n $pageId: ID\n) {\n\n onboardings(\n pageSize: $pageSize,\n pageId: $pageId\n ) {\n next\n count\n list {\n ID\n status\n connectionType\n kmAtInstallation\n activateReadWriteInDevice\n device {\n id\n serial_number\n }\n vehicle {\n id\n vin\n plate\n }\n driver {\n id\n email\n }\n consent {\n id\n whitelistedData\n inherited\n }\n }\n }\n}", "variables":{ "pageSize": 20, "pageId": "1"}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "query fleetInformation(
$pageSize: Int,
$pageId: ID
) {
onboardings(
pageSize: $pageSize,
pageId: $pageId
) {
next
count
list {
ID
status
connectionType
kmAtInstallation
activateReadWriteInDevice
device {
id
serial_number
}
vehicle {
id
vin
plate
}
driver {
id
email
}
consent {
id
whitelistedData
inherited
}
}
}
}", "variables":
{
"pageSize": 20,
"pageId": "1"
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"onboardings" : {
"count" : 3 ,
"list" : [
{
"ID" : "886264233019080716" ,
"activateReadWriteInDevice" : true ,
"connectionType" : "CABLE" ,
"consent" : {
"id" : "886281754993655820" ,
"inherited" : false ,
"whitelistedData" : [
"POSITION" ,
"VEHICLE_IDENTIFICATION" ,
"SIM_IDENTIFICATION"
]
},
"device" : {
"id" : "DEMO-DEVICE-001" ,
"serial_number" : "DEMO-DEVICE-001"
},
"driver" : {
"email" : "cloud.onboarding.test@gmail.fr" ,
"id" : "886264233732374540"
},
"kmAtInstallation" : 123 ,
"status" : "CLOSED" ,
"vehicle" : {
"id" : "886283152710598664" ,
"plate" : "HEM7038" ,
"vin" : "JM1BL1S60A1164559"
}
},
{
"ID" : "886267496113602568" ,
"activateReadWriteInDevice" : null ,
"connectionType" : null ,
"consent" : null ,
"device" : null ,
"driver" : {
"email" : "cloud.onboarding.test@gmail.fr" ,
"id" : "886267496914419720"
},
"kmAtInstallation" : null ,
"status" : "OPEN" ,
"vehicle" : null
},
{
"ID" : "886288988202893320" ,
"activateReadWriteInDevice" : true ,
"connectionType" : "CABLE" ,
"consent" : {
"id" : "886289356418777100" ,
"inherited" : false ,
"whitelistedData" : [
"POSITION" ,
"VEHICLE_IDENTIFICATION" ,
"SIM_IDENTIFICATION"
]
},
"device" : {
"id" : "DEMO-DEVICE-002" ,
"serial_number" : "DEMO-DEVICE-002"
},
"driver" : {
"email" : "cloud.onboarding.test@gmail.fr" ,
"id" : "886288988732588040"
},
"kmAtInstallation" : 123 ,
"status" : "CANCELLED" ,
"vehicle" : {
"id" : "886283152710598664" ,
"plate" : "HEM7038" ,
"vin" : "JM1BL1S60A1164559"
}
}
],
"next" : null
}
}
} Cancel an onboarding Cancel an onboarding that has not yet been finalized.
Cancel an open onboarding
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""
Variables:
{
"requestId": "886288988202893320",
}
"""
mutation onboardingCancel (
$requestId: ID !
$reason: String
) {
request: onboardingCancel (
id: $requestId
reason : $reason
) {
onboardingRequestId : id
status
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "mutation onboardingCancel(\n $requestId: ID!\n $reason: String\n) {\n request: onboardingCancel(\n id: $requestId\n reason: $reason\n ) {\n onboardingRequestId: id\n status\n }\n}", "variables":{ "requestId": "886288988202893320",}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "mutation onboardingCancel(
$requestId: ID!
$reason: String
) {
request: onboardingCancel(
id: $requestId
reason: $reason
) {
onboardingRequestId: id
status
}
}", "variables":
{
"requestId": "886288988202893320",
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"request" : {
"onboardingRequestId" : "886288988202893320" ,
"status" : "CANCELLED"
}
}
} Offboard an onboarding Offboard an onboarding request that has been finalized
Offboarding request
GraphQL
Bash
Python 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""
Variables:
{
"requestId": "886264233019080716",
}
"""
mutation onboardingOffboard (
$requestId: ID !
$resetData: Boolean !
) {
request: onboardingOffboard (
id: $requestId
resetData : $resetData
) {
onboardingRequestId : id
status
}
}
1
2
3
4
5
6
export TOKEN= <YOUR_MUNIC_CONNECT_TOKEN>
curl --request POST 'https://api.munic.io/services/ekko/v2/graphql' \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"query": "mutation onboardingOffboard(\n $requestId: ID!\n $resetData: Boolean!\n) {\n request: onboardingOffboard(\n id: $requestId\n resetData: $resetData\n ) {\n onboardingRequestId: id\n status\n }\n}", "variables":{ "requestId": "886264233019080716",}}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import requests
token = < YOUR_MUNIC_CONNECT_TOKEN>
url = "https://api.munic.io/services/ekko/v2/graphql"
payload = """
{"query": "mutation onboardingOffboard(
$requestId: ID!
$resetData: Boolean!
) {
request: onboardingOffboard(
id: $requestId
resetData: $resetData
) {
onboardingRequestId: id
status
}
}", "variables":
{
"requestId": "886264233019080716",
}
}
"""
payload = payload. replace(" \n " , "" )
headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer %s ' % (token)
}
response = requests. request("POST" , url, headers= headers, data= payload)
print(response. text)
See JSON Answer …{
"data" : {
"request" : {
"onboardingRequestId" : "886264233019080716" ,
"status" : "OFFBOARDED"
} a
}
} The device in configured according to the software version and to the device’s hardware flavor.
Whenever software OTA update is applied, the service migrates the configuration silently according to newer standards using the information provided during the onboarding.