Sample URL for Webhook Listener

I'm using postman to test my webhook listener and somewhere along the line I am not putting the "token" in the correct spot.  I continually get "unauthorized" errors and no debug information at all in Celigo.  Can someone provide some "samples" that show what the post configuration is for postman as well as the raw URL that would be used by the incoming system with some sample data?
Thx,
Paul

0

Comments

5 comments
Date Votes
  • Hey Paul,

    I just created a quick webhook listener, and also tested with Postman.  Please see pics below, and hopefully this helps. 

    P.S. in case it is not obvious, the masked '******' value in the 'Token' field is 'apple', but i changed this already to avoid leaking credentials in clear text.

    integrator.io:

    Postman:

     

    0
  • Scott, thanks for the sample!  Now for a strange problem that I have gotten.  My script all of a sudden is erroring out on a javascript "toString()" function,  Here is the code

    let busdate = options.record.BusinessDate.toString();

    Here is the key/value from the json:
    "BusinessDate": 20220131,

    When I try and "Preview" I get the following error:
    Message: TypeError: Cannot read property 'toString' of undefined
    Location: <anonymous>:20
    Stack: TypeError: Cannot read property 'toString' of undefined
        at transform (<anonymous>:20:43)

    I have been running this transformation script now for weeks with no errors and also use it in this webhook.  When I place the identical json sample in the webhook that is the record brough across from the other integration flow, it produces this error when the other transformation script (the same) runs without a flaw.  This just started occurring today.

     

    0
  • The only issue I can point out is that the single "record" in your preview input is actually an array, and not a single object, and this is why the script is failing.  It you replace the following, then the script will work.   

    let busdate = options.record.BusinessDate.toString();

    with

    let busdate = options.record[0].BusinessDate.toString();

    That said, you should flush out what format of data (rows/array vs object) is expected here, or maybe the script should be enhanced to support either format, etc...

    0
  • Thanks for the quick reply, Scott.

    Here is the same script run from a different integration/flow - not a webhook.  I am using it for the webhook for real-time record updates, but built the first flow to get all my mappings and transformations down.  It works correctly with one or many records being pulled over.  So I'm not sure why I would be getting javascript errors in a another flow and not the same errors in this flow that works every time...

    0
  • The quickest way to solve this is gonna be via a support ticket where they can look at both flows and see why the data is in a different format in one vs the other.  Please pass along this specific message to support "in one of my flows the 'record' is an object {} but in my other flow the 'record' is an array []. why are they different?"

    Support will most likely need to see the exact payload you are posting to the webhook listener url.

     

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post