# Bearer token not working with api call

**URL:** <https://community.servicem8.com/t/bearer-token-not-working-with-api-call/655>\
**Category:** API & SDK\
**Created:** [June 21, 2021, 1:28am UTC](https://community.servicem8.com/t/bearer-token-not-working-with-api-call/655 "2021-06-21T01:28:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![developer](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@developer](https://community.servicem8.com/u/developer)\
**Post date:** [June 21, 2021, 1:28am UTC](https://community.servicem8.com/t/bearer-token-not-working-with-api-call/655/1 "2021-06-21T01:28:32Z")

</div>

**Originally posted by Mario Kazangas**

I am getting this error below when I try to use a bearer token in my custom add on  
Error:“Account trial has expired. Please select an account plan and try again.”  
the format of the API call is as follows

url: ‘[https://api.servicem8.com/api\_1.0/material.json?%24filter=active%20eq%201](https://api.servicem8.com/api_1.0/material.json?%24filter=active%20eq%201)’,  
headers:  
{  
accept: ‘application/json’,  
authorization : 'Bearer '+event.auth.accessToken  
}
