Issue with OAuth Custom Action: application/x-www-form-urlencoded throws 415/400 errors

Hi everyone,

I’m trying to set up a Custom Action to connect with the Orange API for an OAuth authentication flow, but I’ve hit a brick wall with Adalo’s body validation.

Here are the API requirements:

  • Method: POST

  • URL: [https://api.orange.com/oauth/v3/token](https://api.orange.com/oauth/v3/token)

  • Headers:

    • Authorization: Basic [My_Base64_Credentials]

    • Content-Type: application/x-www-form-urlencoded

    • Accept: application/json

  • Body: grant_type=client_credentials

The problem:

  1. If I enter grant_type=client_credentials directly into the Body field, Adalo’s UI blocks me with a “Please enter a valid JSON body” error.

  2. If I wrap it in a JSON format ({"grant_type": "client_credentials"}), the Orange API returns a 415 Unsupported Media Type error because Adalo overrides the content type or structures the payload as JSON.

  3. If I try to pass grant_type as a Query Parameter instead, the server rejects it with a 400 Bad Request stating “Missing grant_type in body”.

    Has anyone found a workaround to native x-www-form-urlencoded POST requests within Adalo without having to route everything through an external middleware like Make/Integromat or Xano?

    Any advice or component suggestions would be greatly appreciated!

Hi @Santiago,

You can’t send “x-www-form-urlencoded” payload from Adalo Custom action. Sorry.

One option - use Make as an intermediary platform. I did that very long time ago with Garmin’s Oauth1, Strava’s Oauth2, etc etc - works pretty well. Scenario may be a bit complicated but I believe it’s doable.

Another option - code a small cloud function (say, on Cloudflare Worker) to serve as intermediary.

Third option - code a custom component which can send requests.

Best,
Victor.

Hi Victor, yes I’m thinking about several options. I’m analyzing the possibility of creating a component. For the past few days I’ve been going crazy with this… The AI also suggested using script.google.com or Pipedream. I’ll look into how to do it and then I’ll let you know. Thanks!

This would be what I would do.