# REST API Bearer Token

**URL:** <https://www.epiusers.help/t/rest-api-bearer-token/122686>\
**Category:** Kinetic ERP\
**Tags:** rest-api\
**Created:** [January 25, 2025, 3:25pm UTC](https://www.epiusers.help/t/rest-api-bearer-token/122686 "2025-01-25T15:25:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgee](https://www.epiusers.help/user_avatar/www.epiusers.help/jgee/32/71125_2.png) [@jgee](https://www.epiusers.help/u/jgee)\
**Post date:** [January 25, 2025, 3:25pm UTC](https://www.epiusers.help/t/rest-api-bearer-token/122686/1 "2025-01-25T15:25:16Z")

</div>

Hi

I have created a Python script that uses the Rest API to pull data from a selection of BAQs.

All works fine on the day it is created but the next day it stops as the Bearer token has changed. Do I need to get a new Bearer token each day?

---

<div class="post-metadata">

**Author:** ![CSmith](https://www.epiusers.help/user_avatar/www.epiusers.help/csmith/32/50752_2.png) [@CSmith](https://www.epiusers.help/u/CSmith)\
**Post date:** [January 25, 2025, 4:31pm UTC](https://www.epiusers.help/t/rest-api-bearer-token/122686/2 "2025-01-25T16:31:11Z")

</div>

See if this link helps:  
[https://www.epiusers.help/t/function-library-working-with-sharepoint/114327/16](https://www.epiusers.help/t/function-library-working-with-sharepoint/114327/16)

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [January 25, 2025, 9:41pm UTC](https://www.epiusers.help/t/rest-api-bearer-token/122686/3 "2025-01-25T21:41:53Z")

</div>

I don’t think that link will help but I think @josecgomez has some code on here somewhere for the epicor token stuff.

(if needed)

As for the bearer tokens, yes they expire, I don’t know the details.

Now that I think about it, the link to my thread may help at least in concept, for storing a bearer token, and just refresh it as needed.

I dunno.

---

<div class="post-metadata">

**Author:** ![CSmith](https://www.epiusers.help/user_avatar/www.epiusers.help/csmith/32/50752_2.png) [@CSmith](https://www.epiusers.help/u/CSmith)\
**Post date:** [January 26, 2025, 1:06am UTC](https://www.epiusers.help/t/rest-api-bearer-token/122686/4 "2025-01-26T01:06:57Z")

</div>

Ya that was the part I remembered from yours. I thought @josecgomez had a post about requesting one through REST, but I couldn’t find it ☹

---

<div class="post-metadata">

**Author:** ![Mark\_Wonsil](https://www.epiusers.help/user_avatar/www.epiusers.help/mark_wonsil/32/51594_2.png) [@Mark\_Wonsil](https://www.epiusers.help/u/Mark_Wonsil)\
**Post date:** [January 26, 2025, 1:00pm UTC](https://www.epiusers.help/t/rest-api-bearer-token/122686/5 "2025-01-26T13:00:46Z")

</div>

This was the closest I could find

> [@Azure AD Authentication (REST via JavaScript / Angular)](https://www.epiusers.help/t/azure-ad-authentication-rest-via-javascript-angular/78431):
>
> We use Azure AD Authentication currently for our Epicor Implementation works great, we are working on a web portal and naturally we wanted to use the same authentication method. Epicor provides some examples in their help on how to do this using azure-activedirectory-library-for-js Which works… (kinda) see this library is pretty old and has been deprecated (twice now) Ultimately being replaced with [GitHub - AzureAD/microsoft-authentication-library-for-js: Microsoft Authentication …](https://github.com/AzureAD/microsoft-authentication-library-for-js)

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [January 26, 2025, 3:07pm UTC](https://www.epiusers.help/t/rest-api-bearer-token/122686/6 "2025-01-26T15:07:35Z")

</div>

Bearer tokens expire usually with a couple of hours if you want to see what the expiration time is paste it into

[jwt.io](http://jwt.io) and it will tell you

This is normal security and you must provide a renewal mechanism. If your app is not going to be constantly up and active you’ll have to either schedule the renewal or simply get a new one right before you make the call if the last one expired.

---

<div class="post-metadata">

**Author:** ![jgee](https://www.epiusers.help/user_avatar/www.epiusers.help/jgee/32/71125_2.png) [@jgee](https://www.epiusers.help/u/jgee)\
**Post date:** [January 26, 2025, 6:05pm UTC](https://www.epiusers.help/t/rest-api-bearer-token/122686/7 "2025-01-26T18:05:57Z")

</div>

Thanks everyone. I found the Ice.LIB.TokenServiceSvc which lets me check and request a new token.

---

<div class="post-metadata">

**Author:** ![datadaddy](https://www.epiusers.help/user_avatar/www.epiusers.help/datadaddy/32/55900_2.png) [@datadaddy](https://www.epiusers.help/u/datadaddy)\
**Post date:** [June 16, 2025, 5:54pm UTC](https://www.epiusers.help/t/rest-api-bearer-token/122686/8 "2025-06-16T17:54:44Z")

</div>

I am trying to use TokenService to get a bearer token, at the moment just using Postman to test

I just use a Get on  
`https:/<instance>/api/v2/odata/OFB/Ice.Lib.TokenServiceSvc`

but this is all I receive in the response

 ![image](https://www.epiusers.help/uploads/default/original/3X/6/5/6575e66a4427350aa5e0134b78a89b9c83d15da2.png)

I am doing this call with Basic Auth

Can you explain how you are using TokenService ?

thanks

---

<div class="post-metadata">

**Author:** ![josecgomez](https://www.epiusers.help/user_avatar/www.epiusers.help/josecgomez/32/55731_2.png) [@josecgomez](https://www.epiusers.help/u/josecgomez)\
**Post date:** [June 16, 2025, 6:20pm UTC](https://www.epiusers.help/t/rest-api-bearer-token/122686/9 "2025-06-16T18:20:38Z")

</div>

> [@Rest with Bearer Tokens - ClientId and Client Secret ?'s](https://www.epiusers.help/t/rest-with-bearer-tokens-clientid-and-client-secret-s/126627/10):
>
> It’s not a Get method you’ll have to use post curl --location --request POST 'https://YourEpicor.Com/EpicorLive10/TokenResource.svc/' \ --header 'username: YourEpicorUserName' \ --header 'password: YourEpicorPassword' \ --header 'Accept: application/json' This will responde with { "AccessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiO\_SNIP\_CAUSE\_H4K3RZ", "ExpiresIn": 28800, "TokenType": "Bearer" }

---

<div class="post-metadata">

**Author:** ![jadixon](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jadixon](https://www.epiusers.help/u/jadixon)\
**Post date:** [June 24, 2025, 2:41pm UTC](https://www.epiusers.help/t/rest-api-bearer-token/122686/10 "2025-06-24T14:41:52Z")

</div>

I am working on a similar issue using Single Sign On. What would it take to make this code work? I don’t want to have to provide credentials since it is SSO. Also, I am working in VBA.
