Initialization
This message is sent by the SDK when the SDK is initialized.
Headers
type
: INIT_SDKauthor
: sdk Idrecipients
: contains userNamestatus
: RECEIVED or ERROR
payload
sdkStatus
: acknowledgement of the SDK initialization
sdkStatus
stop
: Boolean JSON (false
by default) if set totrue
, this means the SDK is stoppedstatusCode
: HTTP status codemessage
: A readable message describing what happened while initializing the SDKserverUrl
: The websocket server URLuserName
: The session id for the SDK (may have been auto generated)sdkName
: The SDK id (sdk_ + userName)webviewName
: The map webpage id (wv_ + userName)webviewUrl
: The webpage you can open for this session to display entities on a map
Important
From now, you will have to send messages like this :
author
:userName
receivedrecipients
:sdkName
received
You will also receive messages like this :
author
:sdkName
receivedrecipients
:userName
received
Note
If the Initialization message was not containing websocket information, the fields serverUrl
, webviewName
and webviewUrl
are not present.
Examples
Example of a successful initialization
{
"type": "INIT_SDK",
"payload": {
"sdkStatus": {
"statusCode": 200,
"message": "Websocket client succesfully started",
"serverUrl": "ws:\/\/localhost:5175",
"userName": "87C07571-7268-4254-8335-BA73951E3C5D",
"sdkName": "sdk_87C07571-7268-4254-8335-BA73951E3C5D",
"webviewName": "wv_87C07571-7268-4254-8335-BA73951E3C5D",
"webviewUrl": "https:\/\/mapview-staging.axioroute.com\/?author=wv_87C07571-7268-4254-8335-BA73951E3C5D&websocketRecipients=sdk_87C07571-7268-4254-8335-BA73951E3C5D&websocketServerUrl=ws:\/\/localhost:5175"
}
},
"author": "sdk_87C07571-7268-4254-8335-BA73951E3C5D",
"recipients": [
"87C07571-7268-4254-8335-BA73951E3C5D"
],
"status": "RECEIVED"
}
Example of a successful SDK Stop
{
"type": "INIT_SDK",
"payload": {
"stop": true,
"sdkStatus": {
"statusCode": 200,
"message": "SDK successfully stopped"
}
},
"author": "SDK",
"recipients": [
"APP"
],
"status": "RECEIVED"
}
Note
In case of a SDK stop, the author and recipients are set with different values than before : the client Id is no longer known