(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.data-privacy-src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-TT9ZP96');

Knowledge Base

Create Map API V2

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"

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-addressOptional, Mandatory if no location latitude/longitude; AlphanumericAddress of the location.
location-latitudeOptional, Mandatory if no location address; NumericLatitude of the location.
location-longitudeOptional, Mandatory if no location address; 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-address": "Fake Address",
          "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