We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Webhooks that does not trigger, a bug?

Hi,

We are implementing a webhook solution and I have some questions.

We are mainly at this stage focusing on webhooks for contact and person.

We have defined the following webhooks:

contact.created (Fire and works ok)
contact.changed (Fire and works ok)
contact.deleted (does not fire, when does this fire?)

person.created (Fire and works ok)
person.changed (fire and works ok)
person.deleted (does not fire, when does this fire?)

We sure want the abilty to add support for:
service.extratable.<TableName> .created/changed/deleted as well but not possible yet if I have understand correctly.

So my question is one does contact.delteted and person.deleted fire? 

 

We have discovered that when a contact or person is deleted from the system in the GUI a:
contact.changed / person.changed fires with som extra payload ( deleteddate).
That is logical since the contact/person is softdeleted. (ends up in the recylcebin)

What I think maybe is a bug, is that no contact.deleted / person.deleted is fired when the recyclebin is cleaned up by the system when background serivce does the hard delete. (eg removing the entry from the database)

If that had occured it would have solved our problem I think.

Another solution would have been to add a special event for the soft delete part.

contact.softdeleted / person.softdeleted and maybe change the contact.deleted / person.deleted to:
contact.harddeleted / person.harddeleted (fired when cleanup process run)

what I also found out when testing was that performing a restore from recyclebin a contact.chagend / person.changed is fired. That is logical since the delteddate is removed (making the entry visible in the GUI again)

Can someone share some thought about when contact.deleted / person.deleted webhooks are fired ?

Tests where performed in the 8.5 R04 version of SuperOffice.

best regards

Anders

 

 

 

 

 

 

RE: Webhooks that does not trigger, a bug?

Hi,

We need an answer :-)

Does anyone know anything about above described issue ?

/Anders

Av: Anders Larsson 16. jan 2020

RE: Webhooks that does not trigger, a bug?

Soft delete vs hard delete: https://community.superoffice.com/en/developer/blog/soft-delete-%E2%80%93-the-undo-revolution/

are the ones you are waiting for actually still in the recycle bin.

Do you have more info in a ticket so it's easier to look into it? Like, is this for Online or on site? If on site, how is this set up?
Since this is done by the ejCron: Webhooks should be configured true on the background job that cleans up, if it is running separately from the main site.

Av: Margrethe Romnes 16. jan 2020

RE: Webhooks that does not trigger, a bug?

Thanks Margrethe!

I have read that article a couple of times. 

The background is that we work on a solution that will send messages to a tibco messagebus, that other systems of the customer will then listen to. Then it is lite bit problematic if we cant catch when the deep-delete happens.

But if I understand correctly the deep delete (scheduled function that cleans up the recycle bin) should fire contact.deleted and person.deleted ? But I might need to add/alter some switch regarding ejCronSchedular ?

We run in on premise environment, at this momen 8.5. R04.

As for now we can catch the contact.changed, person.changed with the extra payload deletedDate to find out when a company/person enters the recylebin. But not when it is cleaned (deepdeleted). We can also catch when a company is restored from the recylebin. (ordinary contact/person.change , would be nice with extra payload there as well deletedDate:reset etc)

As other systems will take action on events generated in superoffice we would not like to send a delete event to the tibco messagebus until deep deleted has happend. Therefore I hoped for contact.deleted /person.deleted should be fired when the cleanup process runs.

at least this article states that there should be webhooks events of type contact/person deleted.

If not fired by the recycle bin clean up process, when are they fired? or are they obsolete?

https://community.superoffice.com/en/content/content/netserver-sdk/netserver-8.x/superoffice-webhooks/

Best regards

Anders

Av: Anders Larsson 16. jan 2020

RE: Webhooks that does not trigger, a bug?

Hi Anders, one of my colleagues had the same issue the other day. We're also using it to sync with another system, and noticed that the person.deleted event didn't fire, and came to the conclusion that it would probably be triggered on the deep-delete. Not sure if we tested and verified though.

You could probably test it by changing the preference to do the deep-delete after only 1 day. Wait until the next day, and see if it did anything.

Av: Frode Lillerud 16. jan 2020

RE: Webhooks that does not trigger, a bug?

Hi Frode!

Yes, that is what this thread is about.

Does the system generate any webhooks event when cleaning up or do we have a bug there...

Yes I actually did that last week before I started this thread and nothing on the registered webhook row for contact.deleted / person.deleted. eg counter +1 hit. etc. When the records in recycle bin was deep deleted and gone from the database. that indicates to me that background cleanup does not generate thoose events. Right or wrong , I do not know. 

But in my world events should be fired from that process.

If you get this to work I am interested in what version you run and so on.
Lets follow up on this.

/Anders

Av: Anders Larsson 16. jan 2020

RE: Webhooks that does not trigger, a bug?

Margrethe, can you elaborate on "Since this is done by the ejCron: Webhooks should be configured true on the background job that cleans up, if it is running separately from the main site."?

Does that mean we should put something like this into ejcrontab.txt?

webhooks = true

 

Av: Frode Lillerud 17. jan 2020

RE: Webhooks that does not trigger, a bug?

Is Service and Sales using the same web services url?

So does the nsEndPoint in the Service config file: https://community.superoffice.com/en/technical/documentation/administration/config-ini/serviceconfig.config/

have Webhooks = true in the web.config?

<Webhooks>
<add key="EnableWebhooks" value="true" />
<add key="RequireHttps" value="true" />
<add key="ValidateHttps" value="true" />
</Webhooks>

Av: Margrethe Romnes 17. jan 2020

RE: Webhooks that does not trigger, a bug?

Hi, Thanks.

Will check the settings. 

Probably service in our case uses the internal endpoint. (Bit same installation).

But Will dig into this as soon as possible, and mer you know.

Av: Anders Larsson 17. jan 2020

RE: Webhooks that does not trigger, a bug?

Hi,

I have now investigated further.

Setup:

SuperOffice Web (ak /sales) are setup using http local adress.
But with values:

<add key="urlPortOverride" value="443" />
<add key="urlSchemeOverride" value="https" />

Since we are using proxy/load balancing over Big IP F5 appliance

Service configuration use the local netServer adress (http) in the above sales (web implementation). As it is still not possible to use https in config for service...

In web.config for /sales /ak also the used netServer we have default:

<Webhooks>
<add key="EnableWebhooks" value="true" />
<add key="RequireHttps" value="true" />
<add key="ValidateHttps" value="true" />
</Webhooks>

Thinking of making RequireHttps and validate https = false to see if that makes any difference ?

the ejCronTab.txt contains:

REM These lines are executed by ejSchedule once every minute
"D:\Applications\SuperOffice\SuperOffice_CustomerService\bin\importMail.exe" tstcrm.xxxxx.intra.local
"D:\Applications\SuperOffice\SuperOffice_CustomerService\bin\ejournalCron.exe" tstcrm.xxxxx.intra.local

The deep clean up / emptying the recyle bin works. ( had 1 company and 1 contact) both deleted but no hit of webhooks registered. (contact.deleted or person.deleted) that if I understand correctly should be registered in this process? 

Other webhooks generated from the GUI and via REST-api works as expected ( eg person/contact.created and person/contact.changed)

select * from crm8.WEBHOOK
shows neither value in total_calls or total_errors for person.deleted/ contact.deleted.
state = 1, so reciving url are correct and working.

in crm8.registry table I have set reg id=186 to: Force use of https protocol  = 1

To solve probelm with buttons etc using SCIL ( for example edit button in marketing view ) 
(http not translated to https when using above described setup using http behind proxy)

/Anders

 

 

Av: Anders Larsson 20. jan 2020

RE: Webhooks that does not trigger, a bug?

Hi,

Have changed from 

<Webhooks>
<add key="EnableWebhooks" value="true" />
<add key="RequireHttps" value="true" />
<add key="ValidateHttps" value="true" />
</Webhooks>

To:

<Webhooks>
<add key="EnableWebhooks" value="true" />
<add key="RequireHttps" value="false" />
<add key="ValidateHttps" value="false" />
</Webhooks>

To see if that leads to any effect.

@Frode => Have you been able to validae if you get contact.deleted or person.deleted when ejournalCron.exe has run and hard deleted  / emptied the recycle bin ? 

@Margrethe/RND => In a perfect world and everything is correctly configured everywhere , ejournalCron.exe operations should trigger a contact.deleted , person.deleted when recycle bin is cleaned ?

If not i think it is a bug and that cleanup should result in contact.deleted and person.deleted.

For testing purposes: Is it possible to force cleanup by manupilation of deleted date on a contact/person and then run ejournalCron.exe manually ? 

 

Best regards

/Anders

 

 

 

Av: Anders Larsson 21. jan 2020