get_country_from_ip_m Sample Call and Response
This example shows a call to get_country_from_ip_m that returns the country of origin for a specified IP address, based on the plsql_m_r73.yml definition file for release 73.
This example includes every field the method accepts, since the call itself takes only a single required filter beyond the standard credentials.
Sample call
{
"rest_call": "get_country_from_ip_m",
"output_format": "json",
"client_no": "10021",
"auth_key": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"ip_address": "203.0.113.42"
}
The ip_address field is required and holds the IP address of the account holder, typically derived from their current session, that Aria looks up to determine a country of origin.
Sample response
{
"country_code": "61",
"country_name": "Australia",
"error_code": 0,
"error_msg": "OK",
"error_details": null
}
An error_code of 0 with an error_msg of OK indicates that Aria resolved the supplied IP address to a country successfully. The country_code field holds the phone number dialing prefix for the resolved country rather than an ISO country code, so a value of 61 corresponds to Australia. This example does not cover the failure case, such as the error response Aria returns when the supplied IP address cannot be resolved to any country.