- Developers
- Mapas Sygic
- Routing API
- Send Route to Navigation
Send Route to Navigation
- Move to section
Please note Sygic does no longer issue new Sygic Maps API keys. This documentation is for existing customers only. If you wish to include maps & navigation into your project, please refer to Sygic Maps SDK.
Overview
Send route to Navigation allows you to send calculated route from server to the Sygic Truck navigation.
Device settings
Currently supported OS is Android only.
Google play services package must be installed on Android device
To be able to receive routes on a device with Sygic Truck GPS Navigation, it has to be enabled under Settings / Connection / Allow push route from server on the device.
Example
Click on the icons to see the code for this example on Github, or explore it in JSFiddle.
Request
API Reference
https://routing.api.sygic.com/v0/api/sendtonavi?key=yourAPIkey
Request authentication is done via parameter key, which must be included in the request URL.
Methods
- POST
Parameters
Required Parameters
Parameter | Data type | Descripion |
name | string | Custom name of the route |
tags | string | Identifier tag of the targeted device. Tags must starts with "login_" (to send the route to a concrete login) or "id_" (to send the route to a concrete device ) followed by alphanumeric and _, @, -, ., :, # characters. |
message | string | Custom message |
directions_api_parameters | object | Input parameters for directions API. For more details see Routing Parameters |
directions_api_result | object | Result from directions API for send to navigation. |
Response
POST https://routing.api.sygic.com/v0/api/sendtonavi?key=yourAPIkey
Content-Type: application/json
Request Body
{
"message": "This route was send from demo.",
"name": "Demo route",
"tags": "login_yourLogin",
"directions_api_parameters": {
"origin": "48.148540,17.107752",
"destination": "48.382242,17.586862"
},
"directions_api_result": {
"route": "ii{dH}}kgBg@dBQr@WjAwAeAOAyBFz@gD\\A",
"eta": 1527770190,
"duration": {
"value": 67,
"text": "1 minute 7 seconds"
},
"distance": {
"value": 316,
"text": "0.32 km"
},
"legs": [{
"distance": {
"value": 316,
"text": "0.32 km"
},
"duration": {
"value": 67,
"text": "1 minute 7 seconds"
},
"start_location": {
"latitude": 48.15013,
"longitude": 17.10575
},
"end_location": {
"latitude": 48.15122,
"longitude": 17.10577
},
"route": "ii{dH}}kgBg@dBQr@WjAwAeAOAyBFz@gD\\A",
"eta": 1527770190
}
]
}
}
Response
Status: 200
After a successful request, a push notification with given route will be send to the specified user/device.
- Previous article: Batch Distance Matrix