Skip to main content

Hi everyone,

We’re delighted to announce this Community Mentoring session with @Naveen Boga!

Webhooks and Acumatica

Naveen will give a session on the use of webhooks with Acumatica

Community Mentoring sessions are approximately 30 minutes and limited to small groups (10-12) of members with one of our power users who is an expert on a topic. If this session is one you feel will help you in your development journey with Acumatica, please let us know in the comments below. We’ll be selecting from those who respond to attend on September 27th at 9am PT(12pm ET). The session will be recorded and recording posted to the Community Resource Library.

Naveen Boga, Technical Lead, Kensium

I would like to attend.


I’d like to attend


I am interested, but I also can yield my spot and wait for the recording if the workshop fills up.


I would like to attend.


Yes please!


I’d like to attend, thank you!


Hello, I would like to attend. 


Hello, I would like to attend


Hello, I will be present at the session


I’m in!!


Thank you everyone who has responded! We have only a couple spots left.


I’d like to join this session.


I am interested.


Hi everyone - We have reached to limit on attendees. We will be recording the session for those who missed the opportunity to participate live. Thank you!


Thank you @Naveen Boga for this great mentoring session! For those who missed it (or would like to watch again) below is the recording.

 

Naveen has also supplied the presentation and sample webhook project attached.

 

 


Thank you, @Naveen Boga.  To follow up from my question in during the session… I am running 23r1.  Acumatica seems to have marked IWebhookHandler as obsolete in PX.Data.Webhooks with a message stating to use PX.Api.Webooks.IWebhookHandler which actually is not available to us yet in 23r1.  From what I understood in this session, we should continue to use it in PX.Data.Webhooks through 23r1 and be prepared to make the change when upgrading to 23r2.

 

 

Thank you for clearing up this confusing misdirection within the Visual Studio IDE on 23r1!


Hi @Brian Stevens  In the 23 R1, both WebhookHandlers are supported. Please refer to my screenshots below. Hope the below info will clarfies.

  1. PX.API.Webhook.IWebhookHandler (Use this, we need to add the PX.Api.Webhooks.Abstraction DLL as a reference)
  2. PX.Data.Webhook.IWebhookHandler (But is obsolete but still supporting 23 R1 and completely removed in the 23 R2)

 

 

23 R1  - PX.API.Webhook.IWebhookHandler

 

23 R1  - PX.Data.Webhook.IWebhookHandler
Recommended to use this DLL from 23 R1 version

 

This info from 23 R1 Developer Release Notes

 

 


Thank you, @Naveen Boga .  I had added PX.Api.Webhooks,dll instead of PX.Api.Webhooks.Abstraction.dll which explains why I couldn’t see it as valid in 23r1.


@Brian Stevens  You're welcome! Thank you for the clarification. Kindly let me know if you have any other questions.


In the older versions of the IWebhookHandler (using PX.Data.Webhooks) I could get the body of the request like this: var result = request.Content.ReadAsStringAsync().Result;

How do I accomplish the same thing with the new version (PX.Api.Webhooks)? 


Now I think the WebhookContext object has request and response, 

so you can read like this

var result = new JsonTextReader(context.Request.CreateTextReader()))

 

Here my example

 

public async Task HandleAsync(WebhookContext context, CancellationToken cancellation)        
{
if (!context.Request.Headers.TryGetValue(HeaderNames.Authorization, out var authValue))
{
context.Response.StatusCode = StatusCodes.Status401Unauthorized; return;
}
if (authValue != "Bearer token")
{
context.Response.StatusCode = StatusCodes.Status403Forbidden; return;
}

using (var scope = GetAdminScope())
{
if (context.Request.Method == HttpMethod.Post.Method)
{
MyCustomGraph graph = PXGraph.CreateInstance<MyCustomGraph>(); using (var result = new JsonTextReader(context.Request.CreateTextReader())) {

… do something
}

@Naveen Boga How do we include “PX.Api.Webhooks.Abstractions” in the customization project?

My customization project does not get deployed and build fails since the dll is missing. I do not see this dll while trying to add files in customization.


@Chris Hackett thanks for posting the webinar recording.
Can you help me find webhook docs? These all 404

https://www.acumatica.com/support/documentation/webhooks-overview
https://www.acumatica.com/support/documentation/webhook-configuration/
https://www.acumatica.com/support/documentation/webhook-events
https://www.acumatica.com/support/documentation/webhook-payload
https://www.acumatica.com/support/documentation/troubleshooting-webhooks/
https://www.acumatica.com/support/documentation/webhook-api-reference/

Hi @okiave - I don’t know where that information lives now but did fine the below on help.acumatica.com

https://help.acumatica.com/(W(1))/Help?ScreenId=ShowWiki&pageid=1f6d085c-7968-4a4f-8b77-f37773911fea

https://help.acumatica.com/(W(4))/Help?ScreenId=ShowWiki&pageid=5c7c820a-7b48-44b0-87da-88b83a4608e6


Reply