Knowledge Base

View Categories

Create Map API V2

2 min read

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 and 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.
  • The latitude/longitude of the location is required. The request will fail and no message will be sent if neither are not included.

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-latitude": "MAP_LOCATION_LATITUDE",
          "location-longitude": "MAP_LOCATION_LONGITUDE"
      }' \
  "API_ENDPOINT_URL"

Success Response: JSON

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:;MAP_LOCATION_NAME;;;
FN:MAP_LOCATION_NAME
item1.URL;type=pref:https://maps.apple.com/?ll=MAP_LOCATION_LATITUDE\,MAP_LOCATION_LONGITUDE&q=4MAP_LOCATION_LATITUDE\,MAP_LOCATION_LONGITUDE
item1.X-ABLabel:map url
END:VCARD

Failure Response: JSON

{
    "status": "failure",
    "error-code": "ERROR_CODE",
    "error-info": "ERROR_INFO",
}

Request Parameters

Param NameOptional/Mandatory; DatatypeDescription
x-api-keyMandatory; AlphanumericAuthentication Key for your account to access API service. Unique Alphanumeric Key can be reset under your Account->API Settings. 
actionMandatory; StringExplains the action for this API Request. Value is Case-Insensitive.
location-nameMandatory; StringName of the location.
location-latitudeMandatory; NumericLatitude of the location.
location-longitudeMandatory; NumericLongitude of the location.

Response Parameters

Param NamePresenceDescription
statusError Response“failure” 
error-codeError ResponseError code associated with the error.
error-infoError ResponseError 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-latitude": "42.3694407",
          "location-longitude": "-71.2374387"
      }' \
  "API_ENDPOINT_URL"

Response Example: 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 Example: Failure

{
    "status": "failure",
    "error-code": "E1801",
    "error-info": "Location Name is required."
}
Go to Top