Community
Showing results for 
Search instead for 
Do you mean 
Reply

Act! Essentials API - questions about webhooks

New Member
Posts: 3
Country: Poland

Act! Essentials API - questions about webhooks

[ Edited ]

Hi, I have two questions about webhooks:

 

1. Documentation says "Register for an HTTP event (such as "contacts_post")" (https://mycloud.act.com/act/Help/Api/POST-api-Webhooks). Where can I find this events list? I need event for contact update.

 

2. To delete webhook, ID is needed (https://mycloud.act.com/act/Help/Api/DELETE-api-Webhooks-id). How can I get ID of a webhook. "GET /api/Webhooks" (https://mycloud.act.com/act/Help/Api/GET-api-Webhooks) does not return ID-s. ID is returned when webhook is created, but how can I delete existing webhooks?

Highlighted
Employee
Posts: 225
Country: USA

Re: Act! Essentials API - questions about webhooks

Hi there,

 

1.  We don't explicitly list out events, but any POST action on any API (other than /webhooks) is supported.

2.  Like most other resources, the ID of the record is created and received on the response from a POST.  I believe the ID is included as a response to a POST, as well as GET /webhooks which returns an array of hooks, is it not?

New Member
Posts: 3
Country: Poland

Re: Act! Essentials API - questions about webhooks

1. I'll try to ask more concrete question. We need webhooks triggered for two events: when contact is created and when contact is updated. Webhook created with {"event": "contact_post"} is triggered on contact creation. What event should we use to create webhook which will be triggered on contact update?

 

2. Id is not included in POST response. See:

 

 

$ curl "https://mycloud.act.com/act/api/Webhooks" -H "Authorization: Basic ____" -X POST -H "Content-Type: application/json" -d '{"event": "contacts_post", "target_url": "https://dff01790.ngrok.io"}' -i
HTTP/1.1 201 Created
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Mon, 06 Feb 2017 15:14:37 GMT
Expires: -1
Location: http://mycloud.act.com/act/api/Webhooks/589892dd295c910a10b756f1
Pragma: no-cache
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Rate-Limit-Limit: 150
X-Rate-Limit-Remaining: 149
X-Rate-Limit-Reset: 2017-02-06 15:15:00 +0000
Content-Length: 66
Connection: keep-alive

{"event":"contacts_post","target_url":"https://dff01790.ngrok.io"}

 

 

 

As you can see there is no id. There is `Location` header which from we can extract ID, but that was not my question.

 

I asked how can we delete already existing webhooks. You answered "as well as GET /webhooks which returns an array of hooks, is it not?". See:

 

curl "https://mycloud.act.com/act/api/Webhooks" -H "Authorization: Basic ____"
[{"event":"contacts_post","target_url":"http://www.google.com"},{"event":"contacts_post","target_url":"http://www.google.com"},{"event":"contacts_post","target_url":"http://www.google.com"},{"event":"contacts_post","target_url":"https://dff01790.ngrok.io"},{"event":"contacts_posts","target_url":"http://www.google.com"}]

It returns array of hooks, but there is no ID.

 

Employee
Posts: 225
Country: USA

Re: Act! Essentials API - questions about webhooks

Hi,

 

1.  We currently don't support any other HTTP action other than POST.  So updates (aka PUT) hooks are currently not supported. 

2.  Appears you will need to keep track if the ID returned in the location header from a POST.  You can also return 410 (Gone) when a hook is called, which will be treated as a delete.

New Member
Posts: 7
Country: Belgium

Re: Act! Essentials API - questions about webhooks

Hi Xavier,

 

My name is Wout and I am driving the integration team of PieSync. To give you some quick information on the firm: PieSync is providing seamless bidirectional contact sync between all major SaaS applications. You can find more information on our current connections here: http://www.piesync.com/connections/.

 

We would be happy to add your application to our growing library of connectors. For this one of our developers has already gone through your API documentation, more specifically at the recipients endpoints.
Thanks for the replies here on this forum. Now all our questions are answered, but it seems we got some blocking issue.

 
 In order to do a proper and efficient sync, we need a way to fetch all the contact updates. We normally do this with one of these three methods:
1. Fetch a list of contacts updated after given time.
2. Fetch a list of contacts sorted (descending) by updated time.
3. Register a webhook.
At the moment the first two options are not possible for us as we've seen there is no such sort/filter option available on your contact list call. The third options is also not possible currently as there is no webhook event for contact updates, only for contact creations.
 
Is it possible any improvements could be done to your API so one of these methods would be possible, please?

 

Thanks in advance.
Kind regards,

Wout

Employee
Posts: 225
Country: USA

Re: Act! Essentials API - questions about webhooks

Hi Wout,

 

Both (1) and (2) are supported.  

 

Here's a few examples:

 

(1)  https://mycloud.act.com/act/api/contacts?$filter=(lastUpdated ge '2017-02-17T21:06:56.865Z')

 

(2) https://mycloud.act.com/act/api/contacts?$orderby=created+desc

 

 

Please note lastUpdated field will not exist if a contact has not been updated after initial create.  

 

Happy to discuss further regarding Pie Sync, please contact me direct.

 

Best,

--Xavier

New Member
Posts: 7
Country: Belgium

Re: Act! Essentials API - questions about webhooks

Hi Xavier,

I seem to have missed your reply, sorry for this.

 

Unfortunately this is not fully supporting our use case as you mentioned yourself "lastUpdated field will not exist if a contact has not been updated after initial create". As such we can't fetch all contact changes (creates and updates) as part of one API call.
Is there any possibility this could be changed, implying that the lastUpdated field is also set at the moment of a create? Note that this how the most of our partners do it and this is hence aligned with the market standards.

 

Thanks in advance.

Kind regards,
Wout

Employee
Posts: 225
Country: USA

Re: Act! Essentials API - questions about webhooks

Hi Wout,

 

You can get all created or update as part of one call: 

 

 https://mycloud.act.com/act/api/contacts?$filter=(lastUpdated ge '2017-02-17T21:06:56.865Z' or created ge  '2017-02-17T21:06:56.865Z')

 

Best,

--Xavier

New Member
Posts: 7
Country: Belgium

Re: Act! Essentials API - questions about webhooks

Xavier,


Thanks for the quick reply again.


I have passed on this information to one of our developers.

I'll get back to you in case there are any more questions.

 

Kind regards,
Wout