HTTP module POST request is not working as expected

Hi guys,

I’m having an issue when using the HTTP module on this specific API: API Reference

It’s a POST request that returns a JSON file (if I use GET, it returns the XLS file since the API uses the same url).

When I use the module, it returns an error that the query parameter is not valid, but if I run this manually, it works correctly!

curl -X ‘POST’
https://dbt.stays.net/external/v1/booking/reservations-export
-H ‘accept: application/json’
-H ‘Authorization: Basic AUTH_KEY’
-H ‘Content-Type: application/json’
-d ‘{
“from”: “2024-12-01”,
“to”: “2024-12-31”,
“dateType”: “arrival”
}’

Does anyone have any idea why the HTTP module is having a different behavior from a manual request?

Thanks
Doug

Hi @Douglas_Tokuno,

Welcome to the Make community!

As this is a POST request, and you are giving Content-Type: application/json as a header, you can pass the parameters as JSON in the body of the request. The cURL confirms that; The -d flag specifies data to be sent in the body of the request.

Could you try that and see if it works?

Cheers,
@Henk-Operative

Hello @Douglas_Tokuno,
As @Henk-Operative suggest try like this.

If you still have issues then share more details with errors.


:bulb:P.S.: Always search first, Check Make Academy. If this is helpful, Mark Best as Solutions :white_check_mark: and give :+1:
If you need expert help or have questions? Contact or comment below! :point_down:

1 Like

It worked! Thank you so much guys!

1 Like