API3
chris at January 22nd, 2022 17:56 — #1
I often use the api contacts?email=[some@email.com] to fetch contacts from our account. I've noticed that sometimes this returns 0 results even though the accompanying email address can be found through the user portal search. It happens for specific email addresses only.
Am I missing something here? I cannot find any common thread between the email addresses that return and the ones that don't.
vladimir at January 24th, 2022 19:02 — #2
Hello Chris!
Could you please provide an email which didn't work for you? Just to check you complaint I created a contact with email 'some@email.com' and queried it via API, so I got the correct contact.
Just a guess: maybe your email contains some chars that aren't URL encoded? Anyway your email would be helpful for further investigation.
Thank you,
Vladimir
vladimir at January 25th, 2022 07:48 — #3
Hi Chris!
In order to proceed with investigation I'd like to ask you for an ID of your account or email of your account (owner) for I could locate your problematic contacts.
Also I'd like you to make sure you're providing correct auth data in your API requests. We recommend using Basic Auth: add header 'Authorization=Basic #{auth_data}' to your requests. About constructing auth_data you can read here https://developer.onepagecrm.com/api/, paragraph Authentication (almost at the top of the page)
Thank you,
Vladimir
vladimir at February 1st, 2022 08:31 — #4
Hi Chris!
We've been analyzing your request all this time and here's what we came up with: it looks like you're trying to obtain a contact which owner isn't the user, you're querying our API with. By default we're exposing contacts which are owned by the requesting user, so if you want to get a contact from your account owned by another user, please try adding team=1 (or team=true) param to you request, i.e. something like
https://app.onepagecrm.com/api/v3/contacts.json?email=some@email.com&team=1
It should help you getting the contact(s) you're looking for. Hope that helped Tell me if you still have the problem and the proposed solution didn't help you. Anyway please ask your questions if you have any.
Thank you,
Vladimir
Powered by Discourse, best viewed with JavaScript enabled