# How do I request Token?

**URL:** <https://community.postman.com/t/how-do-i-request-token/40683>\
**Category:** Help Hub\
**Tags:** oauth2-token\
**Created:** [November 1, 2022, 11:55pm UTC](https://community.postman.com/t/how-do-i-request-token/40683 "2022-11-01T23:55:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![justindoh](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@justindoh](https://community.postman.com/u/justindoh)\
**Post date:** [November 1, 2022, 11:55pm UTC](https://community.postman.com/t/how-do-i-request-token/40683/1 "2022-11-01T23:55:04Z")

</div>

**Your question may already have an answer on the community forum. Please search for related topics, and then read through the [guidelines](https://community.postman.com/t/about-the-just-getting-started-category/37) before creating a new topic.**

> Here’s an outline with best practices for making your inquiry.

_My question_:  
I am trying to follow this instruction. How do I go about doing it?

**Requesting a Token:**

- Use the URL you were provided with the key and secret with the following additions - /rest/api/token
  - Example: [https://www.myisolved.com/rest/api/token](https://www.myisolved.com/rest/api/token)

- To request the token, concatenate the key and secret together separated by a “:” and then base 64 encode it
- Send that to the URL to get the token
- The grant\_type should always be set to client\_credentials
- The access tokens are good for 5 minutes
- The refresh tokens are typically good for 30 days

I have following information provided ( **API Client ID** and **API Secret** ):  
We have completed the isolved setup for the Beecan Health API testing.  
URL:  
[https://snfpayroll.myisolved.com/](https://snfpayroll.myisolved.com/)  
API Client ID: 7b9f39xxxxxxxxxxc1cf77x  
API Secret: 2bkFFe8rctsEhNxxxxxxxxxm58n5WupkhGIq6Qx

_Details (like screenshots)_:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/9/892cbbaf70ac92412c5c6f34471cf2c3d14aacc0.png)

_How I found the problem_:  
I am trying to use Azure Data Factory, and stuck on this area:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/e/0/e011f6188625367b1c367a7406ed1c0b1badfa89.png)

_I’ve already tried_:  
I am not sure where to try to get the Token.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [November 2, 2022, 12:38pm UTC](https://community.postman.com/t/how-do-i-request-token/40683/2 "2022-11-02T12:38:48Z")

</div>

Try and get it working in Postman first. The settings for Azure Data Factory are different, and I doubt anyone here can help with that but can help with trying to get it working in Postman.

You need to create a GET request to the api/clients URL and set the options for the token in the authorisation tab.

In Postman, this should be the following which hopefully you can match up to the instructions.

![image](https://us1.discourse-cdn.com/getpostman/original/3X/1/2/12d0cb6c07fa9878153511ed533c12ff0b73a339.png)

The access token URL should end with api/token as per the instructions.

---

<div class="post-metadata">

**Author:** ![justindoh](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@justindoh](https://community.postman.com/u/justindoh)\
**Post date:** [November 2, 2022, 6:34pm UTC](https://community.postman.com/t/how-do-i-request-token/40683/6 "2022-11-02T18:34:26Z")

</div>

Thank you so much for your help.  
It seems to be getting the token.  
Now, I have a question.  
Which one should I choose (Client Authentication)?  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/0/4/046dd1f954fba2f61a2b4b01c40639f4784ef01b.png)

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [November 3, 2022, 10:51am UTC](https://community.postman.com/t/how-do-i-request-token/40683/7 "2022-11-03T10:51:09Z")

</div>

This is down to the API. The documentation is a bit lacking.

_Use the token to get a list of clients._  
_Use the URL you were provided with the key and secret with the following additions._

Except for, it doesn’t say specifically how to need to use it in this part as it does in the “requesting a token” section.

It looks like there are only two options, so try both.

All requests are show in the console.log, and this includes the authorisation ones.

You should see two API calls, the first one for authentication, and then the main request. You should be able to see if the authentication request is returning any details or not.

---

<div class="post-metadata">

**Author:** ![justindoh](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@justindoh](https://community.postman.com/u/justindoh)\
**Post date:** [November 3, 2022, 11:16pm UTC](https://community.postman.com/t/how-do-i-request-token/40683/8 "2022-11-03T23:16:03Z")

</div>

Thank you so much.  
I am trying to get a response from a Microsoft engineer on the Azure Data Factory side for an error that I got.  
This is [link](https://learn.microsoft.com/en-us/answers/questions/1070198/need-help-to-fill-out-base-url-and-token-endpoint.html) for their support site for my question (as a reference).  
They mentioned about using “Basic” instead of “OAuth”, and I am not sure which data source I need to use to pull data. How do we specify that information?  
Sorry. API is so new to me, and I am trying to get each clue one at a time.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [November 4, 2022, 1:28pm UTC](https://community.postman.com/t/how-do-i-request-token/40683/9 "2022-11-04T13:28:26Z")

</div>

That error is showing a 404 not found.

Which means it can find the server but cannot resolve the rest of the address.

/rest/api/client

If the authentication was wrong, you wouldn’t get a 404 not found, but a different code. Usually 401 unauthorised.

I tried connecting to that end point and get exactly the same error.

How is the API restricted? I’m wondering if it has some sort of whitelisting involved on top of the authorisation token.

---

<div class="post-metadata">

**Author:** ![justindoh](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@justindoh](https://community.postman.com/u/justindoh)\
**Post date:** [November 4, 2022, 6:59pm UTC](https://community.postman.com/t/how-do-i-request-token/40683/10 "2022-11-04T18:59:12Z")

</div>

Sorry. how did you try to connect to that end point?  
Don’t you need Client ID and Secret info?  
Thank you.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [November 7, 2022, 10:43am UTC](https://community.postman.com/t/how-do-i-request-token/40683/11 "2022-11-07T10:43:59Z")

</div>

By creating a new request in Postman and adding the URL. I haven’t included the any of the secret info and I expect it to fail. But I was expecting something like you are not authorised.

The error might be correct though. It can’t find that end point as I’m not whitelisted to see it. Which may be the same issue you are having.
