# Getting access\_token via API call

**URL:** <https://devforum.okta.com/t/getting-access-token-via-api-call/15753>\
**Category:** Questions\
**Created:** [August 27, 2021, 1:16pm UTC](https://devforum.okta.com/t/getting-access-token-via-api-call/15753 "2021-08-27T13:16:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![petr.hybler](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@petr.hybler](https://devforum.okta.com/u/petr.hybler)\
**Post date:** [August 27, 2021, 1:16pm UTC](https://devforum.okta.com/t/getting-access-token-via-api-call/15753/1 "2021-08-27T13:16:09Z")

</div>

Hello,  
I set up OKTA with my application and it’s working fine… users can log in, I can parse and verify the token sent to BE, I can enrich the requests from the data encoded in the token (such as groups, uid, username, …) …

The only problem I have now is: “How do I retrieve the access token via nodejs call or Postman call?”

The reason, why I am asking this is for testing purposes. I need to run my unit tests, but they, of course, need to be authenticated first. So I gotta request the token to include it in the calls I am conducting during the test phase.

Same for Postman, I need to get the token first so I can query and test my endpoints before deployments …

I read several tutorials, primarily in the official documentation but I must be missing something - none of those worked ☹

Could you please refer me to a certain article where I can get that? it’s aggravating me … I know it’s something silly I am missing, but can’t figure it out ☹

---

<div class="post-metadata">

**Author:** ![tyty](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tyty](https://devforum.okta.com/u/tyty)\
**Post date:** [August 27, 2021, 3:15pm UTC](https://devforum.okta.com/t/getting-access-token-via-api-call/15753/2 "2021-08-27T15:15:42Z")

</div>

Hi there! Which tutorials have you been following so far? Are you receiving any particular errors when you go to obtain an access token? Given the nature of the flow, it is a bit tricky as described in the following [thread](https://devforum.okta.com/t/get-an-access-token-manually-for-testing/1646/4), but should be possible.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [February 8, 2024, 7:03pm UTC](https://devforum.okta.com/t/getting-access-token-via-api-call/15753/3 "2024-02-08T19:03:13Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
