How to add form-data as body in outsystems API
Application Type
Traditional Web, Mobile, Reactive, Service
Service Studio Version
11.54.28 (Build 62889)
Platform Version
11.23.1 (Build 40847)

I want to add these input parameters into my API in outsystems:

I did this:

and this is the error I got:

Can anyone suggest me what I am doing wrong here ? or how to fix this ?



Something in your JSON is not good. Did you validated in some online validator, for example?


Yes my json is valid I am using :
const jsonString = JSON.stringify(data);

$parameters.JsonOut = jsonString; 

to send it into my api param


Hi @Faizan Ul Haq ,

Did you check structure which you are using for api response it might be possible that structure is not valid according to Json.

Structure should be capable to hold json otherwise it create problem.

I would suggest to create response structure using copy to response body button inside api window.



Yep already did that !


Good to hear that.

If it's resolved by validating structure then Can you please close this post by marking it as solution so other members can understand this issue has been resolved.



Is the issue solved then? I don't see a statement that the issue has been solved 😅


I mean to say that if it's resolved by validating the structure then close this.

I typed it incomplete, sorry😅

@Faizan Ul Haq . Can you show us the details of the "PostSave" action? I wonder what is happening in there.

It's the api action, please tell me what specifically you'd want to see? @Vincent Koning 

Debug that action. Show me the value of the input parameter just before the exception occurs. 

Also show me the action/code that is calling your API. Perhaps something is going on there.

Resolved this issue usiung multipart/form-dat --boundary, follow outsytems documentation

Nice to hear that you have solved it. Can you link to the documentation for others that run into similar situations?

[object Object]

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.