HTTP Request Authentication for Sharefile

Hey!

Looking to make a simple GET request for Sharefile and am having trouble figuring out how to authenticate properly (getting a 401 error).

The below is Sharefile’s authentication documentation but I can’t figure out which one I should be using and which module.

This is the simple GET request I am looking to do.

This is my current module but clearly I need to authenticate.

1 Like

The URL I used was incorrect but am still getting an authentication error even after I used the correct one.

I was provided a client id/secret but just not sure how the authentication should happen on make.com

Any help? @Msquare_Automation

1 Like

Hi @Bryan_K

You need to pass access token in headers of the http module.

This is Oauth2 connection. So you need to follow three steps from the documentation if you didn’t yet establish the connection:
https://api.sharefile.com/gettingstarted/oauth2

  1. Authorization
  2. Access Token
  3. Refresh Token

Now there are two methods to get the refresh the access token, either you can create custom app or create two scenarios.

One scenario will use refresh token to get the access token. Access token will then be stored in datastore.

Another scenario will have your workflow and will use access token from data store to authenticate the request.

Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation

Hi! Thank you for the explanation and interesting set up. I will definitely try that.

In the meantime, I am having issues just authorizing and getting an access token in the first place.

I am using 2 modules so far:

  1. Authorization (which seems to be working)


  2. Access token


I feel like I am making a very simple mistake. Any obvious reasons you see?

Did some more digging and my guess is i’m doing something wrong with the “grant_type”.

I followed the same step 1 for the code (above).

For step 2 (getting a token) I did a post instead and did the following:


However I am still getting this error. I know my client secret/id are correct so it must be my formatting of the grant_type:

This is the sharefile documentation regarding this:

Any help on this @Msquare_Automation?

1 Like

Hey @Bryan_K

You do not have to write content or header. These are mentioned in doc to help you locate.

Please pass the fields like below image:

Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation

Hi @Bryan_K,

The access tokens should be acquired in the format application/x-www-form-urlencoded. The content of that exists of separate key-value pairs, so you should create a new item for each of the keys. It looks like you have combined grant_type, code, client_id and client_secret in one key-value pair.

Secondly, why don’t you use the HTTP’s OAuth 2.0 module?

Cheers,
Henk

Hello! Thank you for the clarification! I seem to be moving forward in the right direction so I appreciate the help :slight_smile:

These are the key value pairs I did for the fields but now am getting a “missing code” error even though I am just copying from Step 1

This is the “code” step 1 gives me:

Any advice? @Msquare_Automation

Hi Henk! I didn’t know that about x-www-form-urlencoded :sweat_smile: so thank you very much for that information.

I have some other API connections that don’t allow OAuth2.0 which is why I’m trying to do it through “make a request” module as an example. Appreciate the input