none
What's the best way to handle 2 REST API POST calls using the same data retrieved by a Logic App Connector? RRS feed

  • Question

  • I've built a Logic App that pulls Contact information from SalesForce every hour. I now want to make a couple of POST requests in order to add the Contact as a Consumer to another platform using a REST API.

    The data is being retrieved by the SalesForce Connector. Here are the calls I need to make.

    This is the initial POST request I need to make.

    {
    "Gender": "Female",
    "Address1": "1234 Anywhere Lane",
    "Address2": "NULL",
    "City": "Hollywood",
    "State": "CA",
    "ZipCode": "97432",
    "Image": "http://www.someurl.image.png",
    }

    This will return a ConsumerID, which will be used to create the Merchant Consumer.

    Next, create a Merchant Consumer with a POST request and supply the following information.

    {
    "ConsumerId": "SOME ID",
    "MerchantId": "SOME ID",
    "MerchantLocationId": "SOME ID",
    "Email": "first.last@outlook.com",
    "PhoneNumber": "555-555-5552",
    "FirstName": "FIRST NAME",
    "LastName": "LAST NAME",
    "FullName": "LAST NAME, FIRST NAME",
    }

    Can this be done natively within a Logic App or do I need to create a custom API App to handle this? I will also need to convert the MobilePhone retrieved from SalesForce to PhoneNumber.

    Any help is greatly appreciated.

    Thanks,

    Brian


    Sunday, May 10, 2015 8:14 PM

Answers

  • Hi Brian,

    Logic App natively support a HTTP action using which you can POST to your custom REST API endpoint (You can find this on the right side pane in the Logic App Designer) It appears you want to create a custom JSON body and send it in the Post call. So if HTTP action does not meet your requirement, you can definitely write a simple API APP that can do this job for you. Hope this helps.

    Regarding code editor, you can find this in a Logic App designer - When you open an existing logic app (or create a new one), there are buttons on the top bar to switch between Designer view and Code view.

    Let us know if this does not work for you.

    Tuesday, May 12, 2015 4:37 PM

All replies