External APIs with Oath 2.0

Options
 Is it possible to make a request to an external API that needs Oauth 2.0?

I have this example request in curl:
curl -F "client_secret=$CLIENT_SECRET"
-F "client_id=$CLIENT_ID"
-F "grant_type=client_credentials"
-F "scope=your.store"
https://login.domain.com/oauth/v2/token
But I didn't find a way to send this parameters (client_secret, client_id, grant_type and scope) in the request external api interface.

Any ideas here?

Comments

  • Daniel Rjeili
    Options
     did you tried to import this curl in a function stack item "External API Request" ?
     and change the fixed data with concatenation and variables sets?
    (and you can store your "keys" at "instance settings", under Environment Variables, you have Your Variables  )
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    For some reason import curl isn't working with that specific example.

    Let me see what is going wrong. We are doing a release later this evening so I'll make sure a fix for this is included. I'll respond back once fixed.
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Hi Danilo - you would just use the params section to set the parameters. You can use the SET filter to set each parameter path and it's value. You can make the value dynamic with inputs or variables

    [Screenshot_2021-08-09_19-08-58.png]
  • Danilo Toledo
    Options
     thank you! It worked.
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
     the import curl fix is also deployed