# Invalid grant error

**URL:** <https://community.servicem8.com/t/invalid-grant-error/952>\
**Category:** API & SDK\
**Created:** [September 24, 2018, 7:24am UTC](https://community.servicem8.com/t/invalid-grant-error/952 "2018-09-24T07:24:46Z")\
**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:** [September 24, 2018, 7:24am UTC](https://community.servicem8.com/t/invalid-grant-error/952/1 "2018-09-24T07:24:46Z")

</div>

**Originally posted by Lucky**

I create script in php so once i allowed the scope i get access token and refresh token. Then whenever i run file of create contact in servicem8 i get new token from refresh token then use that new token of creating contact. But this automatically stop after 2 or 3 days.

Please tell me how i can solve this
