Table of Contents
Synopsis
This API function creates a map defined in the JSON. The response will return a location vCard file for download. Map details like location name, address, latitude/longitude may be provided.
- A map must have some data added in the request.
- The name of the location in the map is required. The request will fail if the name is not included.
- Either the physical address of the location or the latitude/longitude of the location is required. The request will fail if neither are not included.
- If both the “location-address” and the “location-latitude/location-longitude” values are passed, the “location-latitude/location-longitude” value will take precedence over the “location-address”.
Request: JSON
curl -X POST \
-H "x-api-key: {Api Key}" \
-H "content-type: application/json" -d '
{
"action": "createmap",
"location-name": "{Map location name}",
"location-address": "{Map location address}",
"location-latitude": "{Map location latitude}",
"location-longitude": "{Map location longitude}"
}' \
"{Api Endpoint URL}"
Request Parameters
Param Name | Optional/Mandatory; Datatype | Description |
x-api-key | Mandatory; Alphanumeric | Authentication Key for your account to access API service. Unique Alphanumeric Key can be reset under your Account->API Settings. |
action | Mandatory; String | Explains the action for this API Request. Value is Case-Insensitive. |
location-name | Mandatory; String | Name of the location. |
location-address | Optional, Mandatory if no location latitude/longitude; Alphanumeric | Address of the location. |
location-latitude | Optional, Mandatory if no location address; Numeric | Latitude of the location. |
location-longitude | Optional, Mandatory if no location address; Numeric | Longitude of the location. |
Response Parameters
Param Name | Presence | Description |
status | Error Response | “failure” |
error-code | Error Response | Error code associated with the error. |
error-info | Error Response | Error message explaining the error code. |
Request Example: JSON
curl -X POST \
-H "x-api-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "content-type: application/json" -d '
{
"action": "createmap",
"location-name": "Dunder Mifflin",
"location-address": "Fake Address",
"location-latitude": "42.3694407",
"location-longitude": "-71.2374387"
}' \
"{Api Endpoint URL}"
Response: Success
Output the map file to download (.loc.vcf file)
Content-type: text/vcard; charset=utf-8;
Content-Disposition: inline; filename=location.loc.vcf;
BEGIN:VCARD
VERSION:3.0
PRODID:-//Apple Inc.//iOS 9.2.1//EN
N:;Dunder Mifflin;;;
FN:Dunder Mifflin
item1.URL;type=pref:https://maps.apple.com/?ll=42.3694407\,-71.2374387&q=42.3694407\,-71.2374387
item1.X-ABLabel:map url
END:VCARD
Response: Failure
{
"status": "failure",
"error-code": "E1801",
"error-info": "Location Name is required."
}