Skip to main content

Invalid Credentials when using apiKey:apisecret@api... in URL.

Comments

1 comment

  • Stephen Doyle

    Hi Linda,

    We generally recommend that you use a dedicated API request tool like Postman, or call the API endpoints from your own code, rather than hitting the endpoints manually in a web browser. That said, it should still be possible depending on your environment.

    The authentication method for the Admin API is HTTP Basic Authorization over HTTPS, and a common method of achieving that relies on browser support for the 'shortcut' of passing the credentials as part of the URL like `username:password@host..`

    If the tool you're using doesn't support that due to the deprecation in RFC 3986, please note that you should still be able to set the appropriate header directly, but I'm not sure of the instructions for Thunkable specifically.

    Assuming that you can set headers in the requests made in the tool you're using, you can specify the Authorization by taking the username and password (in this case, the API Key and API Secret), separating them with a colon, creating a base64 encoded version of that string, and including it in the Authorization HTTP header, after the type identifier, which is `Basic`.

    For example, for API Key `123456789` and API Secret `abcdef`:

    Start with `123456789:abcdef`
    Base 64 encoded, this is `MTIzNDU2Nzg5OmFiY2RlZg`
    So to authorize the request, the following header should be used:

        Authorization: Basic MTIzNDU2Nzg5OmFiY2RlZg

    May I ask you to please try that and let me know if it works for you as expected?

    Regards,
    Stephen 

    0

Post is closed for comments.