API3
galfran at April 6th, 2016 04:47 — #1
Hi I'm having problems Authenticating I'm getting a 200 back when I do a post to https://app.onepagecrm.com/api/v3/login.format, but when I do a get to https://app.onepagecrm.com/api/v3/bootstrap.format.json to get the auth_key and other details im getting this error error_message=Could+not+find+more+helpful+message%2C+sorry.&error_name=authorization_data_not_found&message=Authorization+data+not+found&status=401. Do I have to send something with the get to bootstrap.format.json?? because here's is an example of what I am getting back from the post to login
contacts_count%5Ball%5D%5B1%5D=553&contacts_count%5Ball%5D%5Ba%5D=187&contacts_count%5Ball%5D%5Bb%5D=354&contacts_. Any help appreciated. Thanks
cillian at April 6th, 2016 09:05 — #2
Hi there,
Thanks very much for getting in contact with your query.
The word format should never be in any request you make; its presents simply denotes the fact that you can use .json or .xml, where this represents the format.
The URL you should be hitting for login should be exactly the following:
https://app.onepagecrm.com/api/v3/login.json
As you eluded to, you need the auth_key, user_id and other fields from this response to make ANY subsequent requests i.e. you use these fields to "sign" the requests. This includes bootstrap.json and is why you are getting the error message: authorization_data_not_found - this request needs to be "signed"!
For more information on how to "sign" these requests, have a look at our docs (here you will also find working examples for common languages like Ruby, Java, Python).
All the best,
Cillian
galfran at April 7th, 2016 05:51 — #3
Hi Cillian,
Yeah, I figured it out, Thanks for your reply ,just wondering is it possible to set status and lead source when creating a contact and can I send values for custom fields of our contacts. eg where do I get the id for the custom fields that Are created already.
Thanks
cillian at April 7th, 2016 06:54 — #4
Hi again,
It is entirely possible to create a contact with a status and lead source other than the default.
We accept "status text" in the status field, "status id" in the status_id field - either of these will set the status.
We accept both "lead source text" and "lead source id" in the lead_source_id field.
You receive details of all the custom fields on your account when you hit the login or bootstrap endpoint.
Let me know if any of this is unclear.
All the best,
Cillian
galfran at April 7th, 2016 07:06 — #5
Hi Cillian,
Thanks again, just wondering will the custom IDs ever change? and do I need the status ID when Im setting the status
can I send {"status":"Prospect"} when creating contact?
Thanks
cillian at April 7th, 2016 08:47 — #6
Hi,
Apologies, you are not able to send {"status":"Prospect"}, you must send the id: {"status_id":"STATUS_ID"}.
In this case status_id will probably look something like 559cd1866f6e656707000000.
Lead sources are a little bit different, and can be sent with either:
- {"lead_source_id":"LEAD_SOURCE_ID"}
- {"lead_source_id":"LEAD_SOURCE_TEXT"}
All the best,
Cillian
galfran at April 7th, 2016 09:30 — #7
hi,
Thanks, just wondering where do I get these ID's when I am creating a contact?
Thanks
cillian at April 7th, 2016 10:11 — #8
All the info you need e.g. status id's, lead source id's should be in the response from the login or bootstrap endpoints.
All the best,
Cillian
galfran at April 7th, 2016 10:31 — #9
Hi Cillian,
When I login here http://developer.onepagecrm.com/api_browser/ and search the json returned there are no status id's, lead source id' present?? And if I want to set the status to "prospect customer or not contactable" just for example.. how do I send this when creating a contact. Thanks
cillian at April 8th, 2016 04:57 — #10
Hi,
The response from login.json / bootstrap.json should contain info on both statuses & lead sources.
You should see statuses if you search for them in the following format: https://mrkr.io/cUHt4mCzHu.
You should see lead sources if you search for them in the following format: https://mrkr.io/f4HXOuHgqw.
If you wanted to create a contact with status Prospect, you would take the id field from here and put it in the following:
{
"first_name":"John",
"last_name":"Smith",
"status_id":"559cd1a06f6e656707000006",
"lead_source_id":"email_web"
}
All the best,
Cillian
galfran at April 12th, 2016 06:16 — #11
Hi Cillian,
Thanks for all your help.
cillian at April 12th, 2016 10:52 — #12
No problem, glad to help!
All the best,
Cillian
emma02 at November 20th, 2023 04:09 — #14
Hello, your initial login is working fine, but when you try to get more details using a different request, you're getting an error saying "Authorization data not found." After a successful login, you usually get a special code (like a key) that you need to include when making the next request.
Check the instructions or documentation for the OnePageCRM API to see how you should include this code. It's likely you need to add it in the headers or as part of the request when you're trying to get information. Double-check that you're sending this code correctly, and that should solve the problem. If you're not sure, take a look at the API documentation or reach out to OnePageCRM support for helpmendix
Powered by Discourse, best viewed with JavaScript enabled