INFO
Targeting Errors
Error handling for invalid targeting parameters.
The API returns standard HTTP status codes for targeting errors. Understanding these errors will help you troubleshoot and resolve issues quickly.
400 Bad Request
Returned for invalid targeting parameters:
| Error | Description |
|---|---|
| Unknown country code | The country code is not a valid ISO 3166-1 alpha-2 code |
| Unknown state code | The state code is not recognized |
| Invalid state for country | The state does not belong to the specified country |
| Invalid city for state | The city was not found in the specified state/country |
| State specified without country | A state was provided but no country was specified |
| Invalid session ID | Session ID is empty, too long (>25 chars), or contains invalid characters |
Example Error Response
409 Conflict
Returned when a city is ambiguous (exists in multiple states within the country).
Example Error Response
Resolution
Specify the state to disambiguate the city.
Examples
# This will return a 400 error
curl -x http://USERNAME:PASSWORD@res.beta.globalbyte.io:10000 \
-H "country: XX" \
https://httpbin.org/ip# This will return a 409 error - Springfield exists in multiple states
curl -x http://USERNAME:PASSWORD@res.beta.globalbyte.io:10000 \
-H "country: US" \
-H "city: springfield" \
https://httpbin.org/ip# Specify the state to resolve ambiguity
curl -x http://USERNAME:PASSWORD@res.beta.globalbyte.io:10000 \
-H "country: US" \
-H "state: IL" \
-H "city: springfield" \
https://httpbin.org/ipError Responses
Code: 400
Description: Invalid targeting parameters (unknown country, state, city, or session ID).
Code: 409
Description: Ambiguous city - exists in multiple states. Specify the state to disambiguate.
Invalid targeting: Geo targeting error: unknown country code: 'XX'Ambiguous geo target: city 'springfield' is ambiguous in country 'US', found in states: IL, MA, MO, OH