API Connection Help

I have an API that is part of my companies systems. I can connect to it via Postman but I’m having trouble converting that connection to easymorph’s Web Location connector.

In postman, I have a POST call that authorizes me - the url is something like https://someURL.com/aas/oauth/token. In this call, I pass via postman’s “authorization” tab of the call a User Name and Password (our internal team calls this the Client and Secret) which gives me access to the API itself.

Also in the same call within postman the “Body” tab of the call, pass ‘username’, ‘password’, and ‘grant_type’. This username/password is the authentication of the application I’m accessing (if I log into the UI of the application this is what I would use).

Once the call is run, it returns a few fields, most notably the ‘access_token’, ‘refresh_token’, ‘token_type’. In postman call I have a script that takes these tokens and saves them as environment variables so that they can be used for other calls (GET, PATCH, POST) without having to authenticate for each one of those calls.

Where I’m confused is how to convert the postman authentication call to the easymorph web location connection?

Hi @htims05

EasyMorph WebRequest can handle OAuth2 with Authorization Code grant type automatically. (grant_type=authorization_code).

Other authorization methods require a slightly complex workflow design.

Can you show the API documentation? Or at least specify the grant_type you want to use.

grant_type is ‘password’ - unfortunately I can’t share the API documentation.

I was able to get it to work with WebRequest by following this - How to perform OAuth Client Credentials Flow

What I’m trying to figure out now is how to use WebRequest after authenticating to POST data to the API - that data from another table or EasyMorph project.

Just keep adding the Authorization header with the access token to all consequent web requests, as displayed in the last image of the topic you mentioned. The token is effectively a proof of authorization.

1 Like