Announcement

Collapse
No announcement yet.

request body - webhook

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    request body - webhook

    I am working on an integration with a third party company.
    They are sending Webhooks to pages I create.
    The only thing I know is they are sending json in the body.

    How do I grab what they send so I can pare it and deal with it?

    I was looking at javascript response.body but have not gotten anywhere.

    Any suggestions, ideas?

    Bill
    William Gilligan - Orange Marmalade, Inc.
    www.OrangeMarmaladeinc.com

    #2
    Re: request body - webhook

    We did a Paywhirl integration for an animal rescue charity. While we used PHP they also had the basics for dealing with Webhooks via NODE.js

    http://support.paywhirl.com/support/...ssing-webhooks

    Notice each snippet is addressing request.body vs response.body since each Webhook is a treated as a request.

    There is actually a need to generate a response.

    "Remember, with Webhooks, your server is the server receiving the request. Webhook data is sent as JSON in the request's body."

    Hope this helps at least an iota or two.

    Comment


      #3
      Re: request body - webhook

      Originally posted by nottheusual1 View Post
      We did a Paywhirl integration for an animal rescue charity. While we used PHP they also had the basics for dealing with Webhooks via NODE.js
      Thanks for the info.
      I am trying to do as much as possible strictly in Miva Script - however the node.js may be an answer and I will dig into it further!
      Thanks,
      Billl
      William Gilligan - Orange Marmalade, Inc.
      www.OrangeMarmaladeinc.com

      Comment


        #4
        Re: request body - webhook

        In version 5.18 or higher of Empresa there is a variable that may contain the request body. It is named s.content_data

        The reason I say "may" is because this is only set if the Content-Type is not "application/x-www-form-urlencoded" or "multipart/form-data"

        So this may work for you depending on what Content-Type is being set with the web hook request.
        Brennan Heyde
        VP Product
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment


          #5
          Re: request body - webhook

          Originally posted by Brennan View Post
          In version 5.18 or higher of Empresa there is a variable that may contain the request body. It is named s.content_data

          The reason I say "may" is because this is only set if the Content-Type is not "application/x-www-form-urlencoded" or "multipart/form-data"

          So this may work for you depending on what Content-Type is being set with the web hook request.
          Hi Brennan,
          Just an update - this was EXACTLY what I needed.
          Thank you.
          Bill
          William Gilligan - Orange Marmalade, Inc.
          www.OrangeMarmaladeinc.com

          Comment


            #6
            What if it is application/x-www-form-urlencoded?
            William Gilligan - Orange Marmalade, Inc.
            www.OrangeMarmaladeinc.com

            Comment


              #7
              That just means all the data now exists in global variables. application/x-www-form-urlencoded just means data was passed to the server as "First_Name=Bob&Last_Name=Barker" and now g.First_Name and g.Last_Name variables exist.
              David Carver
              Miva, Inc. | Software Developer

              Comment

              Working...
              X