This method retrieves the phone number of the user. It returns a promise that resolves with the phone number or rejects it if there is an error.
Path | /v1/mini-apps/users/profile |
---|---|
Host | https://public-mini-app-merchants.gopayapi.com |
Http Method | GET |
Request Headers:
Property | Data type | Required | Description |
---|---|---|---|
Debug-Id | string | No | This is an identifier that is used for debugging purposes |
Request-Id | string | Yes | This is an identifier that is used for maintaining idempotency |
Authorization | string | Yes | Bearer Authorization header This is the token you would receive in the apply token API |
Response:
Property | Data type | Description |
---|---|---|
success | boolean | It will be true if API call is successful and false in case of failure |
error | object | This object will be non-null only in case of failures |
error.code | string | The error code |
error.description | string | The description of the error |
Sample Response:
Success Response:
{
"success": true,
"error": {},
"data": {
"phone_number": "+628210072773",
"email": "[email protected]",
"username": "example",
}
}
Error Response: With appropriate HTTP status codes. Only 5xx would be retriable
{
"success": false,
"error": {
"code": "105",
"description": "User not found"
}
}
Error codes:
Error code | Description |
---|---|
105 | User not found |
303 | Malformed Authorization |
900 | Unable to process |