Address By Phone
1.1. send pin code
Send pin code is a private API for specific customers to send pin code to client to make sure the national address is belonged to this customer.
Usage:
You must use an access token to make an authenticated call to our system. Access token are generated based on your subscription type. To get your access token please refer to “Your Subscriptions” section available on profile page.
Limits for calls to API
Our system doesn’t apply any limits on number of requests you can make for a particular API. But there are limits defined for total number of calls you can make per min and in one week.
API Request
Input Parameters
Field | Description |
---|---|
StoreId | Store ID for customers. |
MobileNo | Mobile number. |
Api_key | Access token to authenticate you as a valid user of the system. Please refer to profile section to get your subscription key. |
Requested URL
https://apina.address.gov.sa/NationalAddress/v3.1/AddressByPhoneWithPinCode/UPDS API/api/OTP/GetPinCode?StoreId=[StoreId]&MobileNo=[MobileNo]&api_key=[api_key]
Response
Default Fields Returned
The following fields are returned the send pin code request:
Field | Description |
---|---|
ErrorCode | The ErrorCode for the error. |
ErrorFriendlyMessage | The error details. |
Status | The status (true/false). |
SystemErrorMessage | The system error details. |
PinCode | The OPT pincode sent to the mobile. |
SMSBody | The text content of the sent SMS. |
Sample Response
JSON
{
"ErrorCode": "OTP001",
"ErrorFriendlyMessage": "",
"Status": true,
"SystemErrorMessage": "",
"PinCode": "1045",
"SMSBody": " بإدخال الرمز تسمح بمشاركة عنوانك مع ارسل 1045 "رمز التحقق
}
Or
{
"ErrorCode": "OTP005",
"ErrorFriendlyMessage": "Invalid Submitted Data",
"Status": false,
"SystemErrorMessage": "",
"PinCode": null,
"SMSBody": null
}
1.2. Get NA by using pin code
Get NA by using pin code is a private API for specific customers to get national address by phone number after confirming the pin code which you send first.
Usage:
You must use an access token to make an authenticated call to our system. Access token are generated based on your subscription type. To get your access token please refer to “Your Subscriptions” section available on profile page.
Limits for calls to API
Our system doesn’t apply any limits on number of requests you can make for a particular API. But there are limits defined for total number of calls you can make per min and in one week.
API Request
Input Parameters
Field | Description |
---|---|
StoreId | Store ID for customers. |
MobileNo | Mobile number. |
PinCode | Pin code, which you receive on mobile number from first step. |
Api_key | Access token to authenticate you as a valid user of the system. Please refer to profile section to get your subscription key. |
Requested URL
https://apina.address.gov.sa/NationalAddress/v3.1/AddressByPhoneWithPinCode/UPDS API/api/OTP/GetAddresses?StoreId=[StoreId]&MobileNo=[MobileNo]&PinCode=[PinCode] &api_key=[api_key]
Response
Default Fields Returned
By default, only the following fields are returned for a profile request:
Field | Description |
---|---|
waselAddressDetails | This object have list of addresses details or null. |
genericResult | This object have status and error details. |
Sample Response
JSON
{
"waselAddressDetails": [{
"City": "",
"CityName": "",
"District": "",
"DistrictArea": null,
"DistrictName": "",
"LocationX": "",
"LocationY": "",
"LocationZ": "",
"MobileNo": "",
"Street": "",
"Street_NameEn": "",
"StreetName": "",
"UnitNo": "",
"UnitTypeID": ""
}],
"genericResult":{
"ErrorCode": null,
"ErrorFriendlyMessage": null,
"Status": true,
"SystemErrorMessage": null,
"RequestId": -1
}
}
Or
{
"waselAddressDetails": null,
"genericResult": {
"ErrorCode": "Add004",
"ErrorFriendlyMessage":
"Internal API Request Error",
"Status": true,
"SystemErrorMessage": "The transaction under which this method call was executing was asynchronously aborted.",
"RequestId": -1
}
}
Common Errors
If there's an error with your API call, LinkedIn will return a HTTP status code along with a message detailing the error.
Code | Description | Solution |
---|---|---|
400 | Bad Request | The request was invalid, which is usually caused by a programming error. Ensure that the request is formatted correctly. |
401 | "Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key." | Ensure that a valid access token is being used in your API call By catching 401 unauthorized exceptions in all your calls you'll provide the coverage you need in your application to handle expired tokens. It's good practice to design and develop your application in anticipation that with any request you could potentially have an invalid access token. |
403 | Total limit for calls for your subscription has been reached. | You've reached the total limit of calls for web services. Based on your subscription type you have a defined number of calls which can be made. Please refer to “Products” section to know more about your subscription. |
404 | Page not found | The endpoint or resource your application is trying to reach doesn't exist |
500 | Internal Service Error | There was an application error on our server. Usually your request is valid but needs to be made at a later time. |
Error & Alert Notification codes
Alert Code | Description |
---|---|
OTP001 | Success |
OTP002 | Failed to get new PinCode |
OTP003 | Error when get new PinCode |
OTP004 | No Address Found |
OTP005 | Error While Getting the address |
OTP006 | Failed To Get Address |
OTP007 | Invalid Mobile Number |
OTP008 | Invalid StoreId |
OTP009 | Internal API Error |
Add001 | Invalid Mobile Number |
Add002 | Invalid StoreId |
Add003 | Invalid PinCode |
Add004 | API Internal Error |