MyGate

API/Headless Flow

In this mode the API caller is responsible for taking mobile number input from the user and directly passing it to mygate API(s).

  • Call Authorize API with hashed mobile number or email
    • This will trigger an OTP to both mobile and email address of the user and also return a JWT token
  • Call the Get API with the JWT token and the OTP input by the user
    • Use the address(s) returned in the response.

Base URLs

EnvironmentEndpoint
Productionhttps://mavb.mygate.in/address/v1

API Endpoints & Summary

TypeEndpointDescription
POST/authorizeVerify whether the user is MyGate authorized user and returns one time access token
GET/Get address of customer by using 2FA OTP mechanism

Authorize Access

Request

curl --location --request POST 'https://mavb.mygate.in/address/v1/authorize' \
--header 'Content-Type: application/json' \
--header 'mg-xs-api-key: xxxxx' \
'{
"access_uuid_type": "MOBILE_SHA256_HASH",
"access_uuid": "string",
"request_id": "string",
"timestamp": "Long"
}'

Request headers

NameValueMandatoryDescription
mg-xs-api-keyxxxxxYesPartner access API key.

Request Attributes

NameTypeMandatoryDescription
access_uuid_typeEnumYesValues can be MOBILE_SHA256_HASH or EMAIL_SHA256_HASH
access_uuidStringYesSHA256 hash of user mobile number
request_idStringYesUnique request id
timestampLongYesEpoch timestamp in seconds

Response

{
"es": "Integer",
"message": "String",
"access": {
"token": "String",
"expires_in": "Long"
}
}

Response Attributes

NameTypeDescription
esIntegerDenotes error status. 0 if success,1/2 if failure
messageStringSuccess or failure message.
access.tokenStringAccess token to get addresses
access.expires_inLongValidity of the token in epoch seconds

Get Address

Request

curl --location --request GET 'https://mavb.mygate.in/address/v1/' \
--header 'Authorization: Bearer xxxx' \
--header 'mg-xs-api-key: xxxxx' \
--header 'mfa: xxxxx'

Request headers

NameValueMandatoryDescription
mg-xs-api-keyxxxxxYesPartner access API key.
AuthorizationBearer xxxxxYesBearer token received from POST API.
mfaxxxxxYesOTP received on user mobile

Response

{
"es": "Integer",
"message": "string",
"address_list": [
{
"society": "string",
"building": "string",
"flat": "string",
"city": "string",
"pincode": "string",
"full_address": "string"
}
]
}

Response Attributes

NameTypeDescription
esIntegerDenotes error status. 0 if success,1/2 if failure
messageStringSuccess or failure message.
address_listObjectAddress object containing address fields
Suggestions, contact, support and error reporting: [email protected]