How To: HTTP Request Trigger Picks Up Request Paramaters From JSON Payload

David Adams 46 Reputation points
2022-02-07T18:13:26.667+00:00

TL;DR: Can Logic App HTTP request parameters be contained in a JSON payload using a "query_params" object?

I have a very simple Logic App that responds with a 200 Status Code when a HTTP POST request is sent to it. Nothing flashy! When the request parameters are appended to the endpoint URL, this works fine e.g. https://prod-05.uksouth.logic.azure.com:443/workflows/6d598e2263844ace88072f3ed72bf7eb/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=XXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I have a SaaS application (Zoho Bigin in this case) sending my Logic App CRUD notifications, but their Notification API strips out the request parameters from the URL and inserts them into a JSON payload, thus:

{
    "query_params": {
        "api-version": "2016-10-01",
        "sp": "%2Ftriggers%2Fmanual%2Frun",
        "sv": "1.0",
        "sig": "XXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
}

Every time this application sends a notification, it receives a HTTP 400 error from my Logic App, presumably with error text:

{
    "error": {
        "code": "MissingApiVersionParameter",
        "message": "The api-version query parameter (?api-version=) is required for all requests."
    }
}

... in the body, though I cannot confirm this (in my tests sending requests without parameters, this is what I get).

So, is it possible for a Logic App HTTP Request trigger to extract the request parameters from a JSON payload rather than those parameters being sent with the URL?

Any help/advice welcomed.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,928 questions
0 comments No comments
{count} votes

Accepted answer
  1. Alistair Ross 7,106 Reputation points Microsoft Employee
    2022-02-07T23:02:41.673+00:00

    The "When a HTTP request is received" trigger will only accept the request with the queries in a single string.

    However all is not lost! Azure API Management will allow you to parse these requests and trigger a back end logic app. This makes it easier for your organisation to share Api's with third parties and you can update the API interface to your requirements, with your organizations URLS and required authentication. If you ever update the logic app in the future, you won't have to notify the vendor as you can just configure how the API works in the backend.

    A recent blog with instructions on how to do this can be found here


0 additional answers

Sort by: Most helpful