Announcement

Collapse
No announcement yet.

request body - webhook

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

  • temarsh2000
    replied
    So, with the help of Miva Support I figured out what was lacking and am now answering my own post. Miva Store Admin offers two configurable webhooks, one utilizing GET and one POST for the requests in response to an Order being created. The GET webhook apparently (I could not find this in any documentation) only fires a webhook with the Order ID as a query parameter with no request body. Very limited use in my opinion. However the POST webhook provides all documented fields in the request body without any query parameters. This is what I was looking for.

    Leave a comment:


  • temarsh2000
    replied
    How does the s.content_data translate to processing a webhook in a NodeJS environment? I created an Order Workflow in a Miva 10.01 store that sends a webhook whenever an order is created. The webhook fires as expected and I receive a request at my endpoint. The query parameter is populated with the Order ID but the request body is empty and the order data is nowhere to be found. What am I missing?

    Leave a comment:


  • dcarver
    replied
    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.

    Leave a comment:


  • wmgilligan
    replied
    What if it is application/x-www-form-urlencoded?

    Leave a comment:


  • wmgilligan
    replied
    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

    Leave a comment:


  • Brennan
    replied
    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.

    Leave a comment:


  • wmgilligan
    replied
    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

    Leave a comment:


  • nottheusual1
    replied
    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.

    Leave a comment:


  • wmgilligan
    started a topic request body - webhook

    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
Working...
X