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
API Endpoints & Summary
Type | Endpoint | Description |
---|
POST | /authorize | Verify 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"
}'
Name | Value | Mandatory | Description |
---|
mg-xs-api-key | xxxxx | Yes | Partner access API key. |
Request Attributes
Name | Type | Mandatory | Description |
---|
access_uuid_type | Enum | Yes | Values can be MOBILE_SHA256_HASH or EMAIL_SHA256_HASH |
access_uuid | String | Yes | SHA256 hash of user mobile number |
request_id | String | Yes | Unique request id |
timestamp | Long | Yes | Epoch timestamp in seconds |
Response
{
"es": "Integer",
"message": "String",
"access": {
"token": "String",
"expires_in": "Long"
}
}
Response Attributes
Name | Type | Description |
---|
es | Integer | Denotes error status. 0 if success,1/2 if failure |
message | String | Success or failure message. |
access.token | String | Access token to get addresses |
access.expires_in | Long | Validity 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'
Name | Value | Mandatory | Description |
---|
mg-xs-api-key | xxxxx | Yes | Partner access API key. |
Authorization | Bearer xxxxx | Yes | Bearer token received from POST API. |
mfa | xxxxx | Yes | OTP 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
Name | Type | Description |
---|
es | Integer | Denotes error status. 0 if success,1/2 if failure |
message | String | Success or failure message. |
address_list | Object | Address object containing address fields |