Skip to main content

Initialization

This is the first message that has to be sent to the SDK with the function SendEvent.

A callback message will be sent by the SDK.

Headers

  • type : INIT_SDK
  • author : client Id (can be an empty string)
  • recipients : empty JSON Array
  • status : SENT

payload

  • stop : Boolean JSON (false by default) if set to true, this will stop the SDK
  • websocketServer : set this value when you want to instantiate a local websocket server
  • sdkClient : set this value when the application is a client
  • apiCredentials: set this value when the application is a client

websocketServer

This option will instantiate a websocketServer, that can be shared with about 20 users (in a separate application) or just for the client.

  • portNumber : port number to use to communicate with the webview page

sdkClient

Set this object (even with no fields) to indicate that the application is a client one.

  • serverUrl : if the websocketServer is shared indicate the Url, else do not set this value.
  • userName : if blank or null, a unique ID will be generated

apiCredentials

This field is mandatory when using a websocketClient; it contains the credentials to use (see with AxioRoute for account details)

  • baseUrl : APIs URL
  • organization : axioroute
  • apiKey : your API key
  • clientId : your client ID
  • userName : your user Name
  • password : your password
  • clientSecret : your client secret
Tip

If the application does not need to display items on the map using the SDK, do not set webSocketServer and serverUrl

Be careful

If the application stores the credentials to reuse them on the next run, try to encrypt them on application side.

Examples

Example with creation of a dedicated websocket server
{
"type": "INIT_SDK",
"payload": {
"websocketServer": {
"portNumber": 5175
},
"sdkClient": {
"userName": "<a unique user name for the websockect server, if blank a UUID will be used>"
},
"apiCredentials": {
"baseUrl": "https:\/\/api.axioroute.com",
"organization": "axioroute",
"apiKey": "<your API key>",
"clientId": "<your client Id>",
"userName": "<your user Name>",
"password": "<your password>",
"clientSecret": "<your client secret>"
}
},
"author": "",
"recipients": [],
"status": "SENT"
}
Example using an existing websocket server
{
"type": "INIT_SDK",
"payload": {
"sdkClient": {
"serverUrl": "ws:\/\/localhost:5175",
"userName": "<a unique user name for the websockect server, if blank a UUID will be used>"
},
"apiCredentials": {
"baseUrl": "https:\/\/api.axioroute.com",
"organization": "axioroute",
"apiKey": "<your API key>",
"clientId": "<your client Id>",
"userName": "<your user Name>",
"password": "<your password>",
"clientSecret": "<your client secret>"
}
},
"author": "",
"recipients": [],
"status": "SENT"
}
Example using the SDK without websocket
{
"type": "INIT_SDK",
"payload": {
"sdkClient": {
"userName": "<a unique user name for the websockect server, if blank a UUID will be used>"
},
"apiCredentials": {
"baseUrl": "https:\/\/api.axioroute.com",
"organization": "axioroute",
"apiKey": "<your API key>",
"clientId": "<your client Id>",
"userName": "<your user Name>",
"password": "<your password>",
"clientSecret": "<your client secret>"
}
},
"author": "",
"recipients": [],
"status": "SENT"
}
Example with creation of a shared websocket server, for multiple clients
{
"type": "INIT_SDK",
"payload": {
"websocketServer": {
"portNumber": 5175
}
},
"author": "",
"recipients": [],
"status": "SENT"
}

Stop call

Example of a stop call
{
"type": "INIT_SDK",
"payload": {
"stop": true
},
"author": "<author id>",
"recipients": [
"<recipient id>"
],
"status": "SENT"
}