Skip to content

API Call (POST) fails when executing #555

@pstatile

Description

@pstatile

Has your issue been reported?

  • I have searched the existing issues and confirm it has not been reported.

Current Behavior

Hi there. I have a simple API Call (POST) to connect to stripe. If I test the API in the FF section where I define the API, it works fine. If I add a API call from a Widget or from an Action, there seems to be a problem and it returns failure and status code 400.

If I call another API method, if it is a GET method, it works fine! It just happens to the POST Calls. (I am using ContentType: application/x-www-form-urlencoded)

I am using secured API Calls, so I already checked that the ffcloud function is ok in terms of being able to be called by any signed/authenticated user.

Here are a few pics:

Here are a few printscr. I tried many options and only the GET calls work (either from an action or from a widget). And the POST calls do not work.
I have tried from a Test/Run instance as well as from a web instance.

Expected Behavior

Calling the API Post method and getting a Success code and the proper response.

Steps To Reproduce

Create a call to a POST API, secure it, try it from the FF API's section and see it it works. Then, call the api method from a widget and check that it does not work.

Bug Report Code

ITFThc/6w5N2rt9G+KniaO5aqGQ7GUMfWOdEket+EA0hfZDtBLATdczCbVVLYtfmS31DPmH+sEkfwvDpkd/1F+04YU+BUaZTzL5XQQ3jVlGhRcmpELqeW3ZBBeFmJ0yi0cHYnRFCNbBidEYk2mGuffCdG3qCf9qOYwx5e6fDbOY=

Context

I need to create a Stripe Connected account. I am calling the API from the FF API's section and it works fine. It creates the account correctly. Initially I had parameters, but to isolate the problem, I changed the API Call to receive no parameters and hardcode the body params. That way, calling the API is just plain calling the api method. In that way, it cannot happen that trying the API call from the test section and it goes well but executing it from a widget it failed.

Additional info

Captura de pantalla 2023-03-01 a la(s) 09 58 26

Captura de pantalla 2023-03-01 a la(s) 09 59 11

Captura de pantalla 2023-03-01 a la(s) 09 59 24

Captura de pantalla 2023-03-01 a la(s) 09 59 31

Captura de pantalla 2023-03-01 a la(s) 09 59 39

Captura de pantalla 2023-03-01 a la(s) 10 01 16

Captura de pantalla 2023-03-01 a la(s) 10 01 28

Captura de pantalla 2023-03-01 a la(s) 10 00 21

Captura de pantalla 2023-03-01 a la(s) 10 01 45

Environment

- FlutterFlow version: v3.1 (released Feb 27, 2023)
- Platform: Web
- Browser name and version: Chrome 107.0.5304.110
- Operating system and version affected: macOS Monterey 12.2.1

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions