API3
petr at October 11th, 2016 15:19 — #1
Hello, I tried to implement your authentication process using Clojure and I still haven't succeed. I can generate all three headers correctly (verified against Python code) but I am still getting 401 with message same as the this curl call.
curl https://app.onepagecrm.com/api/v3/contacts.json -H "X‑OnePageCRM‑TS: 1476212268" -H "X‑OnePageCRM‑UID: 57f378ec00d4af2f8996b751" -H "X‑OnePageCRM‑Auth: 245be8099c380ae6dcd38fa4ffa1d65cd74c4fde450dc742a86f565fbd274c15" -v
which is {"status":401,"message":"Authorization data not found","error_name":"authorization_data_not_found","error_message":"Cannot find suitable authorization data or data provided is not complete.","errors":{}}
This feels really strange because I have provided all the auth info according to the documentation. Can you please provide some help, I am getting really desperate, thanks.
liam at October 12th, 2016 06:13 — #2
Hello Petr,
Are you using our Python client to verify your auth signature?
The error message you received is only raised if one of the 3 authentication errors is missing. This also does a basic validation, such as checking that the timestamp is an integer
, and that the user id is a BSON ObjectId
.
These values look fine in your sample curl, so I'm not sure what is happening here. It looks like your headers might be ignored from the request.
What version of Curl are you using?
Are you making requests from behind a firewall or proxy?
Does the same request work for you via the python client?
I'm going to do some digging into our logs, and see if I can come up with a solution for you in the mean time.
Kind regards,
Liam
liam at October 12th, 2016 06:50 — #3
I've found it!
I could reproduce your bug when copy-pasting your curl request, but when I type it out myself, there is no problem.
It looks like you are using a different dash character from another char set (maybe ISO 8859-2 ?)
Here is a broken header uses a non-breaking-hyphen:
X‑OnePageCRM‑UID
And here is a correct one using a UTF-8 hyphen-minus:
X-OnePageCRM-UID
Headers with non-standard ASCII characters are dropped by our stack, so we never even received the headers in our application and therefore you got the error that authentication data wasn't found.
liam at October 12th, 2016 08:17 — #4
Hello again Petr,
I found the source of the problem: Our developer documentation had the incorrect dashes used due to an automatic conversion by (I think) Github's web editor. I've fixed this and the developer documentation now uses the correct hyphen character. I'm very sorry for this, especially as it cost you a lot of time and was our error.
Please let me know if you need any further assistance with our API.
Kind regards,
Liam
Powered by Discourse, best viewed with JavaScript enabled