Suddenly receiving CORS error

15 posts / 0 new
Last post
apiboi
Suddenly receiving CORS error

I am receiving a CORS error when trying to generate routes. It was working all day until now.

I checked my transaction report for this month and I have not hit my monthly limit. 


MQBrianCoakley
I suspect this was caused by
I suspect this was caused by going over the transaction limit. The error response does not necessarily include the CORS headers.   Transaction reporting generally runs 5-15 minutes behind and is not intended to be an up-to-the-second indication of usage. 

jvondolteren
We are getting the same error

We are getting the same error for an optimized route request, but not when requesting map markers.  Our plan renews every eigth of the month. But transaction history starts on the twenty-first.  What is the correct timeframe to monitor to ensure compliance to transaction limit?  Wouldn't it be better to send back as part of the response an error if in fact transaction count has been exceeded?


MQBrianCoakley
There is indeed a message to
There is indeed a message to that affect when the transaction quota is exceeded. It just doesn't have the same CORS headers that the successful API response has.   The default transaction reporting period is the previous 30 days. The date range can be changed on the reporting page. It can be set up to show the current term usage by setting the start date to the current term start date.

jvondolteren
So, if 'manage plan' page

So, if 'manage plan' page says plan will renew on the eight of February, what is the current term? Is it the eight of January to the 7th of February? And it seems to me that the CORS header is not correct for responses that indicate transaction quote was exceeded if this is the only tim we get console errors.

Thank you.


MQBrianCoakley
Yes, if the plan shows that
Yes, if the plan shows that it starts on the 8th, it runs through the 7th of the month and renews again automatically on the 8th of the next month.   CORS headers are present for valid API responses. The header is not included for account related errors. They are included for application errors.

jvondolteren
Thank you for your response,

Thank you for your response, Brian. Not trying to be a butt head here, but I'm curious as to why the header is not included for account related errors? How do we trap for repsonses without that header record?


MQBrianCoakley
I believe the authentication
I believe the authentication level response was handled by a tool that we have far less control over than the API backgrounds.

jvondolteren
We have changed plans to the

We have changed plans to the next tier up since we were bumping against the limit. The plan we now use is for 30K limit and allows overages. We are still experiencing the "CORS" error, sporadically when calling the optimized route api.  The call will be successful for several runs and then begins erroring out. The users end of closing the web page, flushing their browser cache ( Chrome ) and then start a new web page. This will alleviate the error occurrences for a few calls , but the error eventually returns.  I'm attaching two URLs for you to paste into a browser. The first displays the error and the second displays the parameter string passed in api call. We hope this can help identify the issue and spark a resolution. 

'mainmenu.heartlandcoop.com/images/mapquest_a.png'

'mainmenu.heartlandcoop.com/images/mapquest_b.png'


MQBrianCoakley
Can you post the text of the
Can you post the text of the request rather than a screenshot of it?   Is there a specific reason to use the open rather than the licensed API? The licensed APIs are far better maintained and, unless there is non-Latin character input, far better data.

jvondolteren
Brian, if I attempt to post

Brian, if I attempt to post the text of the request, teh process says that I am using words the might be spam and therefore, does not save the entry I made.

As for using the open api vs licensed api, I'm not sure what you mean. We've been using this process for the last 5 years. Where do I find documentation for licensed apis?

 

 


jvondolteren
Now I see where the "open"

Now I see where the "open" apis are being used.  I have this line of javascript code,  L.mapquest.open.  If I leave out this line of code will our calls then be using the licensed apis, or do I have to specifically, set the value to false?


MQBrianCoakley
If this is in MapQuest.js,
If this is in MapQuest.js, leaving it out should return to licensed data.

jvondolteren
The error is still occurring

The error is still occurring and we have a) increased transaction limit from 15K to 30K and b) have gone back to licensed data.  I am attempting to trap error in callback from .directions().route() function and hope I can use the error to at least give the users a message and prevent further downstream code from being executed.  That's assuming I'll get something in the error on the call back where the cors header is missing.


MQBrianCoakley
Is there a URL where we can
Is there a URL where we can see this happening?   Your account is well under the number of transactions allowed and the key is working great for me. I suspect there is something else going on here like the key in use is for another account or the request is getting malformed.