API3
martin at October 10th, 2018 10:00 — #1
Hi!
Guys, I have a problem. I can`t see in ZAPIER the custom fields which I create at OnePage. Then the way to make connection betwine Manychat and OnePage is only by API.
So, the question is how to create Custom fields and Tags in OnePage and to find them in Zapier or how to make the connection by API.
Thanks a lot!
vladimir at October 15th, 2018 17:32 — #2
Hi Martin!
Sorry for delay.
You can create custom fields in OnePageCRM UI on the settings page (Gear icon at top right corner -> Settings -> Custom fields tab). After that their values on contacts should be visible via API. Also tags you can create in a contact view or action stream view at the left hand side bar by clicking dropdown arrow in front of Tags submenu -> Add Tag.
Thank you,
Vladimir
kevin at October 24th, 2018 06:30 — #3
Hello Martin,
Thanks for getting in touch.
We use "basic auth" in order to authorize API connections. To use basic auth your need a "username" and a "password". Your username will be your "User ID" and your password will be your api-key.
In order to find this info you can sign into your OnepageCRM account and navigate to https://app.onepagecrm.com/app/api
To check you have the correct info you can try a simple request on our API browser which can be found here https://developer.onepagecrm.com/api_browser/
Again your Username is your "User ID" and your password is your API key. For a test request you could enter "bootstrap" as the resource path to get general user info.
When creating/updating a contact, you can assign tags. If the tag doesn't already exist, OnepageCRM will create it. Don't forget to set 'partial = true' if you don't want to override existing info.
For example to update an existing contact with 2 new tags:
'PUT' request to: https://app.onepagecrm.com/api/v3/contacts/5b72d77ebc905a565f47dd23.json
Request body is as follows
{
'partial': true
'tags': ["VIP", "Awesome Contact"]
}
Unfortunately you can not create custom fields via the API. However, you can create custom fields in the OnepageCRM web application and then use them via the API. To view all of your existing custom fields, make a GET
request to https://app.onepagecrm.com/api/v3/custom_fields
To assign a custom field to a contact you can make a similar 'PUT' request to the above with something like the following as the request body. Make sure to swap the custom_field id with a custom_field id that you found in the GET
request. My example custom field below stores a contacts date of birth.
{
"partial": true,
"custom_fields": [
{
"custom_field": {
"id": "5b72d77dbc906a565f47dcfa"
},
"value": "1985-03-02"
}
]
}
I hope this is clear to you.
Let me know if you have any other problems.
Thanks,
Kevin
martin at October 24th, 2018 07:02 — #4
Hi, Kevin!
This is what I need! The mistake was in the ID and PASSWORD. I used the real one. . .:(
So, now I`m waiting a little bit because I try many times to connect and I hope it will be successful this time.
Thanks a lot!
kevin at October 24th, 2018 08:20 — #5
Sounds great. Glad that we cleared that up!
Good luck with your Manychat integration. Feel free to reach out if you have any more problems with the OnepageCRM API
martin at October 24th, 2018 09:13 — #6
YES! But nothing! And my user ID is my username.
Doesn`t work. . .:(
martin at October 24th, 2018 09:15 — #7
And after Authorisation I can GET some information from the OnePage for a test, is it true? So, when I do authorisation the GET is empty - OK?
martin at October 24th, 2018 09:17 — #8
The last result is:
{
"status": 401,
"message": "Invalid request data",
"error_name": "invalid_request_data",
"error_message": "Invalid login and/or password",
"errors": {}
}
What can be wrong if I just copy and paste the username and password from here:
https://app.onepagecrm.com/app/api
kevin at October 24th, 2018 10:34 — #9
Hi Martin,
When you are using the API you don't need to 'login' as such. Instead you use Basic Auth to authenticate each request.
So what this means is that an authorization header is sent with every request. To generate this header you use your User id and API key that you found above.
Perhaps have a quick look at the "client side" section of this page for an overview of the process: https://en.wikipedia.org/wiki/Basic_access_authentication
As an example, if my user_id is '123456' and my api_key is ''this_is_a_fake_api_key" then the when using Basic Auth, the Authorization
header will be the following:
Authorization: Basic MTIzNDU2OnRoaXNfaXNfYV9mYWtlX2FwaV9rZXk=
Details on how this is done can be found in the above link although most API tools and libraries will provide header generators for Basic Auth. e.g:
Curl: https://ec.haxx.se/http-auth.html
Postman: https://www.getpostman.com/docs/v6/postman/sending_api_requests/authorization
You just need to remember to use your user_id as your username and your api_key as your password.
Hope this cleared up things. Let me know if this works for you.
Kevin
martin at October 24th, 2018 21:29 — #10
Hi, Kevin!
I feel my self very stupid!!! Sorry, but let`s start step by step.
1. I open API from here https://app.onepagecrm.com/app/api to find User ID and API Key.
2. I copy User ID and API Key and paste here: https://developer.onepagecrm.com/api_browser/ 3. I past User ID and API Key like that:
User ID in the field USERNAME and API Key in the field PASSWORD.
4. After that I press LOGIN.
5. After that I have this result:
{
"status": 401,
"message": "Invalid request data",
"error_name": "invalid_request_data",
"error_message": "Invalid login and/or password",
"errors": {}
}
So, the question is: If I make something wrong - what is it?
Next question is - Can you correct me in this way step by step my actions?
If Im doing everything properly why I can
t authorize the connection yet?
Thanks a lot!
Martin
kevin at October 25th, 2018 04:06 — #11
Hi Martin,
When using the API browser (https://developer.onepagecrm.com/api_browser/), you can use your normal username and password that you use to log into the OnepageCRM app with.
When using the API itself, then you use your user_id and api_key outlined above.
Sorry about the confusion!
Kevin
Powered by Discourse, best viewed with JavaScript enabled