170
Views
14
Comments
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 ?

2023-08-28 07-00-10
Paulo Torres
Champion

Hi,

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

Regards

2023-03-03 11-03-26
Faizan Ul Haq

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

$parameters.JsonOut = jsonString; 

to send it into my api param

2025-02-10 17-24-13
Arun Rajput

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.

Regards,

Arun

2023-03-03 11-03-26
Faizan Ul Haq

Yep already did that !


2025-02-10 17-24-13
Arun Rajput

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.

Regards,

Arun

2020-09-21 08-42-47
Vincent Koning

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

2023-03-03 11-03-26
Faizan Ul Haq
2025-02-10 17-24-13
Arun Rajput

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

I typed it incomplete, sorry😅

2020-09-21 08-42-47
Vincent Koning

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

2023-03-03 11-03-26
Faizan Ul Haq

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

2020-09-21 08-42-47
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.

2023-03-03 11-03-26
Faizan Ul Haq

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


2020-09-21 08-42-47
Vincent Koning

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

2023-03-03 11-03-26
Faizan Ul Haq

[object Object]

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