metro.getStateList [HTTP GET]
Retrieve a list of states for a particular country.
Arguments
api_key (Required)
Your API application key. If you don't have one,
create one.
country_id (Required)
The country_id number of the country to look within. To find country_id's, use metro.getCountryList.
Example Response
<?xml version="1.0" encoding="UTF-8"?>
<rsp stat="ok" version="1.0">
<state id="76" name="Alberta" code="ab"/>
<state id="55" name="British Columbia" code="bc"/>
<state id="73" name="Manitoba" code="mb"/>
<state id="284" name="New Brunswick" code="nb"/>
<state id="97" name="Nova Scotia" code="ns"/>
<state id="54" name="Ontario" code="on"/>
<state id="229" name="Prince Edward Island" code="pei"/>
<state id="53" name="Quebec" code="qc"/>
<state id="79" name="Saskatchewan" code="sk"/>
</rsp>
Error Codes
404 Not Found:
- Missing valid api_key - Please create an API key using the above link.
- Your api_key is inactive or not found - Please contact us for support.
- Missing valid country_id parameter - Your country_id may be improperly formatted or non-numeric. Only numeric country_id's are allowed.