Getting country Code
You can get the country code of requesting IP. When an IP exists in the requesting IP field, use the IP. If nothing exists, time zone service checks the requesting client IP to return the relevant country code.
Note
The Time Zone API has a distributed processing environment in case of a failure or poor network. If the communication timeout set for your game server is exceeded due to a failure or network problem, call this API using the distributed environment URL.
| Field Name | Description | Required |
| ip | If the requesting IP(IPv4 or IPv6) is null, it gets the country code through the IP of API-implementing client. | N |
| Field Name | Description | Type |
| result_code | Result code. 0=Success | Integer |
| result_msg | Result message | String |
| timezone | Object-type time zone Refer to the following Timezone object | Object |
| Field Name | Description | Type |
| country_code | Country code based on the ISO 3166-1 alpha-2 | String |
//IPv4
{
"ip" : "127.0.0.1"
}
//IPv6
{
"ip" : "::ffff:dc46:52e7" or "0:0:0:0:0:ffff:dc46:52e7" or "0000:0000:0000:0000:0000:ffff:dc46:52e7"
}
{
"result_code":0,
"result_message":"Success",
"timezone" : {
"country_code":"KR"
}
}
Note
When the country code of requesting IP is not identified, success is returned as result value, and "UNKNOWN" is returned as country_code value.
- Response Sample in case IP unable to identify the time zone
{
"result_code":0,
"result_message":"Success",
"timezone" : {
"country_code":"UNKNOWN"
}
}