Community
Showing results for 
Search instead for 
Do you mean 
Reply

Cannot get Act webhook get to work

Highlighted
Copper Contributor
Posts: 216
Country: Netherlands

Cannot get Act webhook get to work

I've tested the webhooks like described in: https://www.act.com/docs/default-source/user-guides/guides-for-updated-v21.1/act!-premium-web-admini...

 

On one server, I installed the webhook service, started it and posted a new webhook via the API:

 

{
		"monitor": "Contacts",
		"triggerEvent": "Created",
		"queryOption": "$select=fullName",
		"callbackUrl": "https://webhook.site/d47eeee2-49c1-4971-840c-820ab5f38f19",
		"callbackToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ0wNS0zMVQyMDozODowMS41OTI1MTcxWiJ9",
		"description": "Webhook to capture newly created contacts."
		}

But when inserting a contact, it didn't call the callbadkUrl. I get the following in the webhook-notifications.log log file:

 

 

   at Act.Webhook.Notifications.ActWebHookMessengerService.GetToken(HttpClient client, Registration registration) in c:\gitroot\act.webhook.notifications\act.webhook.notifications\ActWebHookMessengerService.cs:line 472
2020-06-12 14:24:14,886 [13] DEBUG Act.Webhook.Notifications.ActWebHookMessengerService - GetSymmetricKeyForCache(): Search cache for symmetric key for tenantId: APFW
2020-06-12 14:24:14,886 [13] DEBUG Act.Webhook.Notifications.ActWebHookMessengerService - Ready to encoding claims and set default headers to call the API's authorize endpoint
2020-06-12 14:24:14,902 [13] ERROR Act.Webhook.Notifications.ActWebHookMessengerService - Token: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjQzMTcwZmY1LTBkYzctNDBiMC1iNzg1LWFkZTJhZjNhZmM4MSIsInN1YiI6ImZib2Vyc21hIiwiYWlkIjpudWxsLCJzdnIiOiJUWlRFU1QtQUNUREVWMDEiLCJkYiI6IkRFTURCIiwiaXNzIjoibG9jYWxob3N0IiwiaWF0IjoiMjAyMC0wNi0xMlQxMjoyNDoxNC44ODY0MjI1WiIsImF1ZCI6bnVsbH0.89Eln0AehMg64nDhkfngK9PuUH2dbgIUiLedQx9AFnw
2020-06-12 14:24:14,902 [13] ERROR Act.Webhook.Notifications.ActWebHookMessengerService - Claims: UserId:43170ff5-0dc7-40b0-b785-ade2af3afc81, UserName:fboersma, Server:TZTEST-ACTDEV01, Database:DEMDB, TenantId:APFW, BaseUrl:https://tztest.tendenzcloud.nl/act.web.api
2020-06-12 14:24:14,902 [13] ERROR Act.Webhook.Notifications.ActWebHookMessengerService - Token Exception: Unable to generate token.
System.Exception: Token Failure: HTTP StatusCode: 401 : Unauthorized was sent when requesting a token.
   at Act.Webhook.Notifications.ActWebHookMessengerService.GetToken(HttpClient client, Registration registration) in c:\gitroot\act.webhook.notifications\act.webhook.notifications\ActWebHookMessengerService.cs:line 472
2020-06-12 14:24:21,665 [17] WARN Act.Webhook.Notifications.ActWebHookMessengerService - OnStop: Stopped the Act! Webhook Messaging Service.

What to do about this?

 

Furthermore, when I restart the act webhook messenger service, it won't start again untill I delete the webhook via the API, start the service up again and re-post the webhook via the API. Shouldnt be this way I think? When a server restarts for maintenance we shouldn't have to re-enter all those webhooks..

Greetings,

ACT Certified Consultants
TendenZ
the Netherlands