[SOLVED] API cURL client_secret

I have a cURL Example:

curl -X POST ‘https://ims-na1.adobelogin.com/ims/token/v3?client_id={CLIENT_ID}
-H ‘Content-Type: application/x-www-form-urlencoded’
-d ‘client_secret={CLIENT_SECRET}&grant_type=client_credentials&scope={SCOPES}’

Im not quite sure where to put -d above (Client Secret, Client credentials and scopes), can someone point me in the right direction on how to configure this?

This is what I have so far (I know its not much).

Any help would be greatly appreciated!

I was able to solve the server to server credentials and initialize this call for authentication but still have one last issue below:

and it returned
“access_token”: “string of characters”,
“token_type”: “bearer”,
“expires_in”: 86399

Should I be somehow trying to pass the returned information of the “access_token”: “string of characters”, “token_type”: “bearer”, into the Value: Bearer $token somehow ?
I don’t have a bearer token anywhere else in the developer console.

I’ve been fumbling around with this and could really use some guidance.
I do get an error when initializing the Execute Actions API call:
{"error_code":"401013","message":"Oauth token is not valid"}

First, you should use Bubble auth feature set to custom token instead of non self handled. Second, you cannot use $token and expect Bubble to teplace that by something else. You need to put the access token in this field to initialize it. Anyway, if you use Bubble custom token auth, you will not need to add authorization header.

Hi @Jici
Thank you so much for the response. When you mention Bubble auth feature set do you mean this one:

If so Im not sure which to select (documentation from the site says they use OAuth 2 but doesn’t specify which one…

Oauth2 custom token

1 Like

After, you may need to put everything in url like ?client_secret=…&grant_type=client_credentials (and so on…)
Or put in the body as client_secret=…&grant_type=…
Check the API do intiialize with a simple get request like get current user to test your setting

So I had a lot of things going wrong in this one but am very thankful for Jici’s support as they solved this one.

I wanted to reply in case it can help anyone else out in the future.

For Authentication

  • Authentication was set to OAuth2 Custom Token
  • The Token endpoint (POST) was the same with the client_id attached to the end of the link.
  • Content -Type was the same (in the Header)
  • The JSON body had ‘client_secret={CLIENT_SECRET}&grant_type=client_credentials&scope={SCOPES}’
  • The Shared headers for all calls (key: x-api-key, Value: Client_id)

For API POST call (Use as: Action, Data type: JSON)
Headers: key: content-type Value: application/json
Body (JSON)

{
   "inputs": [
  {
      "href":"<href>",
      "storage":"<storage>"
  }
   ],
   "options": {
  "actions": [
    {
      "href":"<href_action>",
      "storage":"<storage_action>"
    }
  ]
   },
   "outputs": [
  {
    "href": "<href_output>",
    "storage": "<storage_output>",
    "type": "<type>",
    "overwrite": <overwrite>
  }
   ]
}

Once the call is initialized you should see: _links self href

Get Request (Use as: Data, Data type: Text)
GET and the endpoint
Once initialized should see the Welcome message in text.

I learned a lot from this:
I didn’t need to set the authorization in another call.
My initial Post request had all of the line numbers from where I copied it from the documentation (very easy to not notice).
In the Body JSON field names, use a unique naming convention (instead of <storage><storage>, use <storage_input><storage_output> that suits your needs).
Booleans, JSON specific are not in quotes.

I don’t think I would have ever figured this out Thank You @Jici

2 Likes

Hi @luminrabbit DO you have some screenshots of your config? Would be awesome to have a look :slight_smile: as I am stuck on the same thing