Customer Portal

How to make HTTPConnector POST request with JSON from JSONWriter

Comments 2

  • Avatar
    anyeone
    0
    Comment actions Permalink
    Hi there,

    I've been posting to a lot of REST services from my Clover projects so hopefully I can assist.

    If you have the JSON write to a port, you should be able to send it as input to a Reformat object that has the HTTPConnector_Request as its output metadata.

    Then, map the JSON to the requestContent of the output. (If you have any other dynamic content for your HTTPConnector_Request you can configure it in this Reformat as well. For example, I create the URL dynamically using job parameters.)

    In the HTTPConnector_Request you can set the HTTP action as PUT, POST etc. as needed and set the URL that you are posting to.
    Then in the Input Mapping you can drag the requestContent from the request to the HTTPConnector's requestContent (and set any other parameters you configured in the Reformat and mapped to the HTTPConnector_Request.

    I hope that helps you figure it out!
  • Avatar
    admin
    0
    Comment actions Permalink
    Hi,

    I have reviewed your situation too and I decided to create an example graph for you so that you can review the exact HTTPConnector setup on your original graph (I have slightly updated the graph and simplified it for testing purposes).

    I would recommend you to start from a scratch with the HTTPConnector and update only following fields: URL (whatever you have used for MailChimp before), Request method (POST), Input Mapping (more details below and in the graph) and Username/Password.

    I would like to bring to your attention especially Input Mapping attribute. On the Input mapping screen, map "field1" to the requestContent field.

    In addition, I have also noticed that in the URL attribute you are using parameter ${MC_LIST_ID}, which is not defined in the graph that you have provided for review. I suppose that you are using "externalized parameter" and that is why it is not part of the graph. Is that right? If not, make sure the parameter is defined as well.

    Please review and let us know if you have any follow-up question.

    Eva

Please sign in to leave a comment.