MyGate

Geofence V2

Geofence API is used to obtain the geofence and name for all MyGate communities which are enabled for a specific partner and can be utilized by the partner for local filtering of EARs. As new communities are onboarded on MyGate frequently, the partner needs to call this API on a daily basis to maintain data consistency.

Base URLs

API Endpoints & Summary

TypeEndpointDescription
GET/partner/geofencesFetch geofence and society name enabled for Partner.

'x-api-key' is visible on Express Entry Dashboard.

Fetch Geofence

Sample cURL

curl --location --request GET 'https://ecom.kappa.mgmaglev.xyz/delivery/devops-intg/v2/partner/geofences?cityName=XxXxXx&validSocieties=XxXxXx&pageNumber=1' \
--header 'x-api-key: XxXxXx'

Request Headers

NameValueMandatoryDescription
x-api-keyXxXxXxYesPartner access API key.

Query Parameters

NameTypeMandatoryDescription
cityNameStringNoFetch geofences for a particular city.
validSocietiesStringNoFetches only communities which have greater than 3 geo-points. Possible values are "yes" and "no.
pageNumberIntegerNoPage number for pagination using 1-based indexing (starts from 1). Defaults to page 1 if not specified. Each page contains a maximum of 2000 societies.

Response

{
"es": "Integer",
"message": "String",
"data": [
{
"geofence": [
{
"latitude": "Double",
"longitude": "Double"
},
{
"latitude": "Double",
"longitude": "Double"
},
{
"latitude": "Double",
"longitude": "Double"
},
{
"latitude": "Double",
"longitude": "Double"
},
{
"latitude": "Double",
"longitude": "Double"
}
],
"society_name": "String",
"city_name": "String",
"gate_lat_long": [
{
"latitude": "Double",
"longitude": "Double"
}
],
"society_id": "String"
}
],
"pagination_metadata": {
"current_page": "Integer",
"current_page_size": "Integer",
"total_pages": "Integer",
"has_next": "Boolean"
}
}

Response Attributes

NameTypeDescription
esIntegerDenotes error status.
messageStringSuccess or failure message.
dataArrayContains list of partner enabled MyGate community geofences.
geofenceArrayGeofence of a MyGate community in the form of a closed polygon.
society_nameStringName of MyGate community.
city_nameStringCity in which the MyGate community is located in.
gate_lat_longArrayArray of the MyGate community gate locations.
society_idStringUnique identifier for each MyGate community. If required, need to be communicated to the team.
latitudeDoubleLatitude as part of geofence or gateLatLong array.
longitudeDoubleLongitude as part of geofence or gateLatLong array.
pagination_metadataObjectContains metadata for paginating through results.
current_pageIntegerCurrent page number (1-based).
total_pagesIntegerTotal number of available pages in the result set.
has_nextBooleanIndicates whether additional pages are available.
current_page_sizeIntegerNumber of elements in the current page (maximum 2000 societies).

Possible Combinations of Error State and Message

esmessage
1Resource access denied.
1Reason for exception
0Success
0No Society Enabled
Suggestions, contact, support and error reporting: [email protected]