cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi,

I'm trying to trigger an Azure Logic App from ByDesign but for some reason, even though I have the api-version in the URL it still doesn't run that Logic App. It works perfectly from Postman though. I get the following error (400 - Bad Request):

I created a Web Service in Cloud Application Studio that is using the generated POST request URL details from the Logic App. After that I created the communication scenario, then in ByDesign I created the Communication arrangement. Then I created an action for triggering this Logic App where I execute the external webservice call:

import ABSL;

var HttpMethod = "POST";
var HttpResource = "/workflows/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/triggers/manual/paths/invoke"; 
var ContentType = "application/json";                        
var Body = ""; 
var HeaderParameter : collectionof NameAndValue;  // not required

var URLParameter: collectionof NameAndValue;
var URLParameterEntry :NameAndValue;

URLParameterEntry.Name = "api-version";
URLParameterEntry.Value = "2016-10-01";

URLParameter.Add(URLParameterEntry);

URLParameterEntry.Name = "sp";
URLParameterEntry.Value = "%2Ftriggers%2Fmanual%2Frun";

URLParameter.Add(URLParameterEntry);

URLParameterEntry.Name = "sv";
URLParameterEntry.Value = "1.0";

URLParameter.Add(URLParameterEntry);

URLParameterEntry.Name = "sig";
URLParameterEntry.Value = "xxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx";

URLParameter.Add(URLParameterEntry);

URLParameterEntry.Name = "AccountingPeriodVar";
URLParameterEntry.Value = this.AccountingPeriod.content;

URLParameter.Add(URLParameterEntry);

URLParameterEntry.Name = "CompanyCodeVar" ;
URLParameterEntry.Value = this.CompanyCode.content;

URLParameter.Add(URLParameterEntry);

var wsresult = WebServiceUtilities.ExecuteRESTService("CS_Trigger", "Trigger_EWS", "POST", HttpResource, URLParameter, HeaderParameter,ContentType, Body);

var contentResult = wsresult.Content;

The resulting RequestURL seems good, I tested it in Postman. But for some reason it still believes that the api-version is missing from it so the call is seemingly never made.

The RequestURL looks like this in CAS: https://*********.*********.logic.azure.com:***/workflows/***************************************/tr...

Can anyone help me with this?

Thank you!

0 Likes
View Entire Topic
planteksz
Explorer
0 Likes

After months of investigation from SAP support finally they figured out what was the problem.

Instead of var Body = "";

I should have declared it like var Body = "{}";

This solved the issue and now I was able to trigger the POST request.