Forum Discussion

RykerSchenck's avatar
RykerSchenck
Qrew Member
4 days ago

HTTP Request - Body

Hey Y'all. I have a question on how the Body works in the HTTP Pipelines Channel. 

Before I begin I have everything working and set up correctly (Was able to do it in Postman and was able to do GET Requests in Pipelines) 

I cannot figure out how to insert my body in HTTP node. I have tried a lot of things to get this to work. I double checked the encoding but maybe there is another option I need to use? I think my problem lies in the to__json Jinja function (If i even need to use it) 

Any tips are appreciated!! 

This body I was able to use in Postman and it worked! 

 

7 Replies

  • Maria's avatar
    Maria
    Community Manager

    At office hours today, Sam suggested trying the webhook channel instead. Hopefully, you can follow up and let us know if you get different results RykerSchenck​  

  • Mez's avatar
    Mez
    Qrew Assistant Captain

    Looking at the api documentation, can you try to get/fetch a sub, add your id or email within the url path, not the body, and see if the remote api accepts your get request. 

    Based on the data you've outlined, it looks like you're trying to create a new user or update/insert one, then using post does require the body to have an email address (you have valid json), but the remote service doesn't like it. Is this email address already a current user?

    What does postman show as the response? And, if you change the error option to custom, what happens in pipelines? 

     

    • RykerSchenck's avatar
      RykerSchenck
      Qrew Member

      The email is already a Subscriber (me) but this is from the Mailerlite documentation: "If a subscriber already exists, it will be updated with new values. This is non-destructive operation, so omitting fields or groups will not remove them from subscriber."


      When I did Custom Errors I got the same error message from the body

      ("body:{"message":"The email field is required.","errors":{"email":["The email field is required."]}}")

      but Pipelines exempted the error 

      Here is my Postman response:

      Here is my 200 ok using GET from Pipelines: 

      Trying many different things and I am completely stumped on why its not working.

      Might just throw in a Ticket to Support. 

      • Mez's avatar
        Mez
        Qrew Assistant Captain

        Agreed. Everything looks good to me. 

  • Mez's avatar
    Mez
    Qrew Assistant Captain

    If you change the method to "POST", the body part/property within the make request action will appear. Other methods are supported with sending a body part/property, but GET is not one of them, and most api's are not expecting a body with a get request. 

    • RykerSchenck's avatar
      RykerSchenck
      Qrew Member

      Hi Mez, thanks for the feedback! I do have the call set to POST.  I was just saying I have got 200 ok GET request to work fine. I have also tried the full URl in Path and just /Subscribers. Anything else I could be missing? 

      here is my input:


      method:POST

      path:https://connect.mailerlite.com/api/subscribers

      step_headers:No value

      query_params:No value

      expected_payload_type:json

      schema_sample_type:json-sample

      validate_response_payload_type:true

      body:{ "email": "ryker@------.com" }

      encoding:utf_8

      errors:automatic