API3
malonehedges at June 14th, 2016 14:52 — #1
What does this error mean and how can I fix it? I can provide my code if needed, but I am getting a specific error "Expired" and I'm curious to what this means.
malonehedges at June 14th, 2016 14:54 — #2
{"error_name":"expired","status":400,"message":"Expired","error_message":"Could not find more helpful message, sorry.","errors":{}}
liam at June 15th, 2016 05:45 — #3
Hello Malone,
This error means that the timestamp(X‑OnePageCRM‑TS
) you used when calculating the signature (X‑OnePageCRM‑Auth
) is too old. Please make sure that it is no older than a few minutes, and that you are using a UTC timestamp.
The error message isn't very helpful so I've updated it to explain exactly what the problem is.
Thank you for your feedback,
Regards,
Liam
malonehedges at June 15th, 2016 20:05 — #4
Do you have the specific amount of time that is "too old"? I am generating it right before I send my request.
Also, I get "expired" when I send a request with an invalid X-OnePageCRM-Auth
, is there an error message that relates to an invalid Auth signature?
malonehedges at June 15th, 2016 20:07 — #5
I see that it is 30 minutes after calling it again.
My other question remains though, I can send correct UID, TS, but a string of "Hello world" as the Auth and I still get a Expired
error.
liam at June 16th, 2016 03:12 — #6
Hi Malone,
Yes, the time is now set to 30 minutes. We were hoping to use a shorter time frame in which the Timestamp is valid, but as some services which integrate with us can be off in time by 5-10 minutes, we went with the more lenient 30 minutes.
Regarding your remaining question:
We check the Timestamp before we check the UID & Auth token. The Timestamp is the only parameter which can result in an Expired
error. So let's check the Timestamp param to make sure it's OK.
Firstly, are you sure it is in seconds? It should look like this: 1466061190
.
It has to be in UTC, not in any local timezone.
If this is the case, could you please pass on your code related to creating the timestamp and sending it. Hopefully we will be able to get to the bottom of this problem.
Regards,
Liam
malonehedges at June 16th, 2016 17:34 — #7
Thanks for the quick and helpful reply. That is good to know that the Timestamp is checked first.
I went back to my code and I was using the UNIX Time in milliseconds. After changing that my code now is working. I was confused from an earlier test when I had my timestamp in seconds but wasn't correctly handling the Auth signature, resulting in an error still.
I now have a working connection to the OnePageCRM API on Node. I'll likely separate this from my application so the community can use it as well.
Thank you for the help!
Powered by Discourse, best viewed with JavaScript enabled