Location
The value for this input datatype will be available in the session object in the following format:
Attribute Name | Datatype | Description |
Meta | map | Location Meta (A) |
Value | map | Location Details (B) |
Attribute Name | Datatype | Description |
Type | String | 'location' |
Value | map | Location Co-ordinates (C) |
Attribute Name | Datatype | Description |
country | String | Name of the country ex: 'USA' |
country_code | string | Country code ex: 'us' |
city | string | Name of the city ex:'Seattle' |
state | string | Name of the state ex:"Washington" |
district | string | Name of the district ex:"East District" |
full_address | string | Full address ex:"9241 13th Ave SW Seattle, Washington(WA), 98106" |
This datatype has to be returned in the plug response in the following format:
Attribute Name | Datatype | Description |
Latitude | string | Latitude of the location ex: "latitude":"8.77486" |
Longitude | string | Longitude 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;