Skip to product menu
Skip to main content

Location 

The value for this input datatype will be available in the session object in the following format:

Attribute NameDatatype Description
MetamapLocation Meta (A)
ValuemapLocation Details (B)

Location Meta (A)

Attribute NameDatatype Description
TypeString'location'
ValuemapLocation Co-ordinates (C)

Location Details (B)

Attribute NameDatatype Description
countryStringName of the country ex: 'USA'
country_codestringCountry code ex: 'us'
citystringName of the city ex:'Seattle'
statestringName of the state ex:"Washington"
districtstringName of the district ex:"East District"
full_addressstringFull address ex:"9241 13th Ave SW Seattle, Washington(WA), 98106"

​​

This datatype has to be returned in the plug response in the following format:

Location Co-ordinates (C)

Attribute NameDatatype Description
LatitudestringLatitude of the location ex: "latitude":"8.77486"
LongitudestringLongitude of the location ex: "longitude":"78.13423"

Sample Code:

Format received in input "session" object:

Copied{
      "meta":{
         "type":"location",
         "value":{"latitude":"8.77486","longitude":"78.13423"}
      },
      "value":{ 
                        "country":"USA",
                        "country_code":"us",
                        "city":"Seattle",
                        "latitude":"8.77486",
                        "district":"East District",
                        "state":"Washington",
                        "full_address":"9241 13th Ave SW Seattle, Washington(WA), 98106","postal_code":"628001","longitude":"78.13423" 
                 }
   }

Format to be returned in response object:

Copiedresponse=map();
response.put('location' ,	 {"latitude":"8.77486","longitude":"78.13423});
return response;