Back to list

location/

A list of all of the locations by country in alphabetical order.
* National administrators can hide locations from this API call, meaning there may be locations within the system that are not returned by this function.

Extra Parameters:

Parameter none
Example https://api.agclassroom.org/api/location/

HTTP Method

GET

Requires authentication:

No

Return Format:

JSON

Return Example:

{

success:true

message:All of the locations.

resultcount:68

result: [...]

0 {...}

id:2

state: {...}

name:Alabama

abbreviation:AL

country: {...}

name:United States

abbreviation:US

1 {...}

id:3

state: {...}

name:Alaska

abbreviation:AK

country: {...}

name:United States

abbreviation:US

2 {...}

. . .

}

Back to list

location/id/{id}/

Return all the information on one specific location.

Extra Parameters:

Parameter id
Type number
Description This identifier must be known previously or be pulled from the location call.
Example https://api.agclassroom.org/api/location/id/32/

HTTP Method

GET

Requires authentication:

No

Return Format:

JSON

Return Example:

{

success:true

message:Found 1 location.

resultcount:1

result: [...]

0 {...}

id:5

state: {...}

name:Arkansas

abbreviation:AR

country: {...}

name:United States

abbreviation:US

}

Back to list

location/state/abbr/{abbreviation}/

location/province/abbr/{abbreviation}/

location/country/abbr/{abbreviation}/

Return one specific location by state/province/country abbreviation.

Extra Parameters:

Parameter abbreviation
Type string
Description The abbreviations used in the system are the standard postal code abbreviations.
Examples https://api.agclassroom.org/api/location/state/abbr/VA/
https://api.agclassroom.org/api/location/province/abbr/NT/
https://api.agclassroom.org/api/location/country/abbr/US/

HTTP Method

GET

Requires authentication:

No

Return Format:

JSON

Return Example:

{

success:true

message:Found 1 location.

resultcount:1

result: [...]

0 {...}

id:47

state: {...}

abbreviation:VA

name:Virginia

country: {...}

abbreviation:US

name:United States

}

Back to list

location/state/name/{name}/

location/province/name/{name}/

location/country/name/{name}/

Return any locations by state/province/country name.

Extra Parameters:

Parameter abbreviation
Type string
Description Any string that is part of a name, or a full name.
Examples https://api.agclassroom.org/api/location/state/name/Georgia/
https://api.agclassroom.org/api/location/province/name/Ontario/
https://api.agclassroom.org/api/location/country/name/United_States/

HTTP Method

GET

Requires authentication:

No

Return Format:

JSON

Important Notes:

No spaces are allowed in a name. Underscores will work in place of spaces - for example: "/location/province/name/prince_edward_island/". States/provinces/countries are found by a wildcard match (%SEARCH%), so something like "/ar/" would return 8 locations: Arizona, Arkansas, Deleware, Maryland, North Carolina, Ontario, Prince Edward Island, South Carolina. To only return one state/province/country, you may want to pass the entire name.

Return Example:

location/state/name/rk/

{

success:true

message:Found 2 locations.

resultcount:2

result: [...]

0 {...}

id:5

state: {...}

abbreviation:AR

name:Arkansas

country: {...}

abbreviation:US

name:United States

1 {...}

id:33

state: {...}

abbreviation:NY

name:New York

country: {...}

abbreviation:US

name:United States

}