Webportal v2

embedded apps

API Reference - navigation.favoriteDestinations

Required Privacy: Always available
Plateforme Compatibility:

This API allows to manage favorite location.

Input Parameter
Param name Description Type Unit/Values Example Required
locationAttributes

Location attributes to output in response.

Array of strings

- address

- coordinates

- mapMatchedCoordinates
['address', 'coordinates', 'mapMatchedCoordinates'] false
Output Data
Data name Description Type Unit/Values Example
name

Name of this favorite location.

string

n/a

favorite1
address

Address of this favorite location.

Object

n/a

coordinates

Coordinates of this favorite location.

string

/
coordinates
 .longitude

Next maneuver longitude.

number

n/a

8.74301
coordinates
 .latitude

Next maneuver latitude.

number

n/a

8.74301
coordinates
 .altitude

Next maneuver altitude.

number

n/a

8.74301
mapMatchedCoordinates

Map matched coordinates of this favorite location.

Object

/
mapMatchedCoordinates
 .longitude

Next maneuver longitude.

number

n/a

8.74301
mapMatchedCoordinates
 .latitude

Next maneuver latitude.

number

n/a

8.74301
mapMatchedCoordinates
 .altitude

Next maneuver altitude.

number

n/a

8.74301
Code Example
1
2
3
4
5
6
7
8
9
10
11
12
13
webportal.get(
    /* api name */
    "navigation.favoriteDestinations",
    /* parameters */
    "['address', 'coordinates', 'mapMatchedCoordinates']"
  )
  /* callback for `REPLY` messages */
  .then((message) => {
    if (message.status === 200) {
      /* handle `REPLY` success */
    }
    else { /* handle `REPLY` error */ }
  })
1
2
3
4
5
6
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0", 
  "type": "GET", 
  "api": "navigation.favoriteDestinations",
  "params": "['address', 'coordinates', 'mapMatchedCoordinates']"
}
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
// --- format of the `REPLY` message ---

{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "REPLY",
  "api": "navigation.favoriteDestinations",
  "status": 200,
  "statusText": "OK", 
  "data": [
    {
      "name": "Kiran's Club",
      "address": {
        /* ApiKitTypes::SAddress */
        },
      "coordinates": {"latitude": 8.74301, "longitude": 8.74301}
      "mapMatchedCoordinates": {"latitude": 8.74301, "longitude": 8.74301}
    },
    {
      "name": "Vishal's Villa",
      "address": {
        /* ApiKitTypes::SAddress */
        },
      "coordinates": {"latitude": 8.74301, "longitude": 8.74301}
      "mapMatchedCoordinates": {"latitude": 8.74301, "longitude": 8.74301}
    },
  ] 
}

false

This API allows to manage favorite location.

Providing Address & Coordinates together will produce a 400 Bad Request error (provide only one!)

Input Parameter
Param name Description Type Unit/Values Example Required
action

Action to perform.

Enum of String

- add

- change

- remove
add true
location

Location Object to remove. Only if action = remove

Object

/ /
location
 .name

Name of the favorite location to remove.

string

n/a

Egor's Castle true
location

Location Object to add/change. Only if action = add or action = change

Object

/ /
location
 .name

Name of the favorite location to add/change.

string

n/a

Egor's Castle true
location
 .address

Name of the favorite location to add/change. Only one between address and coordinates should be provided.

string

true
location
 .coordinates

Coordinates of the favorite location to add/change. Only one between address and coordinates should be provided.

string

/ /
location
 .coordinates
  .longitude

Next maneuver longitude.

number

n/a

8.74301
location
 .coordinates
  .latitude

Next maneuver latitude.

number

n/a

8.74301
location
 .coordinates
  .altitude

Next maneuver altitude.

number

n/a

8.74301
Output Data
No outputted data
Code Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
webportal.set(
    /* api name */
    "navigation.favoriteDestinations",
    /* parameters */
     {
  "action": "add"
  "location": {
      "name": "Egor's Castle",
      // Only ONE (address OR coordinates) of the following field MUST be provided
      "address": {
        /* ApiKitTypes::SAddress */
      },
      "coordinates": {"latitude": 8.74301, "longitude": 8.74301}
} 
  )
  /* callback for `REPLY` messages */
  .then((message) => {
    if (message.status === 200) {
      /* handle `REPLY` success */
    }
    else { /* handle `REPLY` error */ }
  })
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0", 
  "type": "SET", 
  "api": "navigation.favoriteDestinations",
  "params":  {
  "action": "add"
  "location": {
      "name": "Egor's Castle",
      // Only ONE (address OR coordinates) of the following field MUST be provided
      "address": {
        /* ApiKitTypes::SAddress */
      },
      "coordinates": {"latitude": 8.74301, "longitude": 8.74301}
} 
}
1
2
3
4
5
6
7
8
9
// --- format of the `REPLY` message ---

{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "REPLY",
  "api": "navigation.favoriteDestinations",
  "status": 200,
  "statusText": "OK"
}

false

This API allows to manage favorite location.

Input Parameter
No input params
Output Data
Data name Description Type Unit/Values Example
action

Action performed on the favorite triggering this event.

Enum of strings

- add

- change

- remove
add
location

Location triggering this.

Object

/
location
 .name

Name of this favorite location.

string

n/a

location
 .address

Address of this favorite location.

Object

location
 .coordinates

Coordinates of this favorite location.

string

/
location
 .coordinates
  .longitude

Next maneuver longitude.

number

n/a

8.74301
location
 .coordinates
  .latitude

Next maneuver latitude.

number

n/a

8.74301
location
 .coordinates
  .altitude

Next maneuver altitude.

number

n/a

8.74301
location
 .mapMatchedCoordinates

Map matched coordinates of this favorite location.

Object

/
location
 .mapMatchedCoordinates
  .longitude

Next maneuver longitude.

number

n/a

8.74301
location
 .mapMatchedCoordinates
  .latitude

Next maneuver latitude.

number

n/a

8.74301
location
 .mapMatchedCoordinates
  .altitude

Next maneuver altitude.

number

n/a

8.74301
Code Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
webportal.subscribe(
    /* api name */
    "navigation.favoriteDestinations",
    /* parameters */
     null,
    /* callback for `NOTIFY` messages */
    async (notifyMessage) => {
      if (notifyMessage.status === 200) {
        /* handle `NOTIFY` response */
      }
      else { /*  handle `NOTIFY` error  */ }
    }
  )
  /* callback for `REPLY` messages */
  .then((message) => {
    if (message.status === 200) {
      /* handle `REPLY` success */
    }
    else { /* handle `REPLY` error */ }
  })
1
2
3
4
5
6
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0", 
  "type": "SUBSCRIBE", 
  "api": "navigation.favoriteDestinations",
  "params":  null
}
1
2
3
4
5
6
7
8
9
10
11
// --- format of the `REPLY` message ---
// type: acknowledge the status of the subscription
// reception: only once after the subscription request
// contains outputed data: no
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "REPLY",
  "status": 200,
  "statusText": "OK"
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// --- format of the `NOTIFY` message ---
// type: event message about the subscription
// reception: each time the conditions of the subscription are met
// contains outputed data: yes
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "NOTIFY",
  "api": "navigation.favoriteDestinations",
  "status": 200,
  "statusText": "OK", 
  "data": {
    "action": "change"
    "location": {
        "name": "Kiran's Club",
        "address": {
          /* ApiKitTypes::SAddress */
        },
        "coordinates": {"latitude": 8.74301, "longitude": 8.74301}
        "mapMatchedCoordinates": {"latitude": 8.74301, "longitude": 8.74301}
    }
  } 
}