API3
ciprian_digitalya at December 8th, 2021 04:30 — #1
Hi there,
A. I have some issues when I'm trying to change a contact status through following API call:
PUT https://app.onepagecrm.com/api/v3/contacts/${contact_id}/change_status/${status_id}
- ${contact_id} - is the id of the contact
- ${status_id} - is the id of the status
When I execute this API call I get no errors, but I get back the contact response with the same status as before.
I am pretty sure that the parameters contact_id and status_id are correct.
B. Another issue is when trying to add a deal to an organization with following API call:
POST https://app.onepagecrm.com/api/v3/deals
{
contact_id,
status: 'won',
amount: 100,
}
For some reason this API call never returns and the deal entry is not created.
sajedalmorsy at December 8th, 2021 06:55 — #2
Hi Ciprian,
For the second part (Deal endpoint):
we are receiving the error when trying to use the body you posted in our requests to API, Could you please check it again from your side with the following body:
{
"contact_id": "CONTACT_ID_GOES_HERE",
"name": "Good deal",
"status": "won",
"amount": 100,
}
ciprian_digitalya at December 9th, 2021 03:13 — #3
Hi Sajed, thanks for quick reply!
The first issue with status seems to be fixed.
The problem remains with deal endpoint. The API call never returns.
This is the JSON body that I'm sending:
body: {
"contact_id": "61b05ed05d9a2646b4b641a9",
"name": "Deal won",
"status": "won",
"amount": 220
}
sajedalmorsy at December 9th, 2021 03:36 — #4
Hi Ciprian
Thanks for confirming that the first issue is resolved
Could you please share the code you are using for making the API request to create a deal ? that would help a lot
Sajed
ciprian_digitalya at December 9th, 2021 03:58 — #5
Yep sure, the code is written on nodeJS
This is the place from where I'm making the API call:
https://ibb.co/7tZPNDx
And this is the content of executeRequest function:
https://ibb.co/Ydc1pmy
sajedalmorsy at December 9th, 2021 06:42 — #6
Thanks for sharing the code
I've copied the code that you shared in the following angular environment:
https://codesandbox.io/s/test-deals-post-endpoint-onepagecrm-cs61u?file=/src/app/app.component.ts
and it seems to be working.
Could you please check the code from the link above and confirm if it works for you (After replacing the userID and token with yours) ?
Screenshot of the response that I'm getting using the code from the link above:
ciprian_digitalya at December 9th, 2021 08:57 — #7
I'm trying to create a deal for an organization. It seems that the deals API is only working for contacts.
I'm getting 404 not found error when I try to add a deal for a company/organization.
sajedalmorsy at December 9th, 2021 09:30 — #8
Hi Ciprian,
Thanks for confirming it's working with contacts.
Currently deals must be assigned only to contacts.
getting the deals for an organization will get you all deals assigned to contacts whom are part of that organization.
Very best
Sajed Almorsy
Powered by Discourse, best viewed with JavaScript enabled