Response When Max Queries Reached

7 posts / 0 new
Last post
gw1500se
Response When Max Queries Reached

I am beginning to write a java application that is using this API. I've not been able to find anything in the docs about responses when max queries has been reached. Indeed, it is not clear how queries are counted. In my case I will be using the route matix and doing one to many (allToAll(false)) queries. My questions are:

1) Is each location considered a query or is each post considered a query regardless of number of locations (I'm guessing the former)?

2) When the max is reached what will  the response look like (XML).

3) Assuming each location is one query, what would the response be if say there are 10 queries left before max and the post data contains 15 locations?

TIA.


MQBrianCoakley
What constitutes a
What constitutes a transaction is described in the Developer Network FAQ.    When the limit has been exceeded a plain text message is returned saying that the limit has been exceeded.   If the request needs 15 geocodes and only 10 transactions are available, the error message is returned.

gw1500se
Thanks for the reply. Is

Thanks for the reply. Is there a specific 4xx code to check for or is it embedded as the error text in a generic 4xx return code? I need to know what to programatically look for in the response. As for the last, does it return a partial valid response (10 of the 15) or just the error code?
 


MQBrianCoakley
The exceeded transactions
The exceeded transactions response will be a http 403 and it will not be a partial response. It will be a failed request.

gw1500se
Thanks again. According to

Thanks again. According to the documentation 403 is a key error. If it is also a limit exceeded error, how do I tell the difference?


MQBrianCoakley
Yup, the key is beyond its
Yup, the key is beyond its transaction limit. The difference will be the message returned. "The AppKey submitted with this request is invalid." vs "You have exceeded the number of monthly transactions included with your current plan. If you need additional transactions, please consider upgrading to a plan that offers additional transactions. If you would like to talk to an Account Manager about Enterprise Edition licensing options, please contact sales@mapquest.com."

gw1500se
Ah! The actual reason is in

Ah! The actual reason is in the returned body (non-XML or JSON) rather than part of the HttpResponse. That was the part I was missing. Thanks.