Entity Information
Data type: MapItem, fields list
URL: /api/mapitems
HTTP Method: POST
Description
Create new map item.
To create new Map Item using the Trakopolis API server you need to pass JSON or XML serialized object with following properties:
| Property | Required | Type | Default | Description |
|---|---|---|---|---|
| DivisionId | No | Numeric | - | Division Id |
| Name | Yes | String | - | Name of Map Item. Can contains up to 255 symbols. |
| Latitude | Yes | Numeric | - | Latitude |
| Longitude | Yes | Numeric | - | Longitude |
| IconUrl | No | String | - | URL of the icon. |
| MapItemActions | No | list of actions | - | |
| MapItemDetails | No | list of details | - |
Each Map Item can contains number of actions. Each action has following properties:
| Property | Required | Type | Default | Description |
|---|---|---|---|---|
| Name | Yes | String | - | Name of Action. Can contains up to 255 symbols. |
| ActionUrl | Yes | String | - | Url to call. |
| HttpMethod | Yes | String | - | Request method. Must be equals to one of http method. |
| HttpBody | No | String | - | Message body for POST or PUT request. |
| IconUrl | No | String | - | URL of the icon. |
| BasicAuthUserName | No | String | - | Username for basic authentication if required. Can contains up to 255 symbols. |
| BasicAuthPassword | No | String | - | Password for basic authentication if required. Can contains up to 255 symbols. |
| IsRestCall | No | Boolean | False | If true request will be send as a rest call. If false request will be opened in a new tab. |
| IsInput | No | Boolean | False | If true input field will be displayed. |
Each Map Item can contains number of details. Each detail has following properties:
| Property | Required | Type | Default | Description |
|---|---|---|---|---|
| Name | Yes | String | - | Name of Detail. Can contains up to 255 symbols. |
| Type | Yes | String | - | Type of Detail. Must be equals to one of type. |
| Value | Yes | String | - | Value of Detail. |
JSON-based request example:
{
"DivisionId": 1,
"Name": "Map Item 7",
"Latitude": 1.0,
"Longitude": 1.0,
"IconUrl": "http://url.com",
"MapItemDetails": [
{
"Name": "Name",
"Type": "String",
"Value": "Value"
}
],
"MapItemActions": [
{
"Name": "Name",
"ActionUrl": "http://action.com",
"HttpMethod": "Get",
"HttpBody": "",
"BasicAuthUserName": null,
"BasicAuthPassword": null,
"RestCall": false,
"IsInput": false
}
]
}