# Invalid token errors and authorisation error.

**URL:** <https://forum.mautic.org/t/invalid-token-errors-and-authorisation-error/3962>\
**Category:** Product Support\
**Created:** [May 24, 2016, 1:48pm UTC](https://forum.mautic.org/t/invalid-token-errors-and-authorisation-error/3962 "2016-05-24T13:48:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sigognac](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Sigognac](https://forum.mautic.org/u/Sigognac)\
**Post date:** [May 24, 2016, 1:48pm UTC](https://forum.mautic.org/t/invalid-token-errors-and-authorisation-error/3962/1 "2016-05-24T13:48:33Z")

</div>

I have succeeded to make functional API, as oAuth1 and oAuth2. Unfortunately both APIs are not working in the end.  
  
For testing I have used API tester (please see [https://github.com/mautic/api-library/blob/master/apitester/index.php](https://github.com/mautic/api-library/blob/master/apitester/index.php)). I have tried regular Postman callback. Therefore I am not convinced, whether the documentation is valid.  
  
Variant with oAuth1: Authorized - when the lead is input into Mautic, I receive the error: “Invalid token”  
  
Variant with oAuth2: When authorized, I receive parameters code and state. This parameters should be later used for receiving own token. When I get accessToken, there is an error invalid\_grant and error message: “The authorization code has expired”. Unfortunately I haven’t received any parameters, yet.  
  
  
  
Can you help with this one, please?  
  
  
  
Thank you!

---

<div class="post-metadata">

**Author:** ![Sigognac](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Sigognac](https://forum.mautic.org/u/Sigognac)\
**Post date:** [May 24, 2016, 1:48pm UTC](https://forum.mautic.org/t/invalid-token-errors-and-authorisation-error/3962/2 "2016-05-24T13:48:33Z")

</div>

I have succeeded to make functional API, as oAuth1 and oAuth2. Unfortunately both APIs are not working in the end.  
For testing I have used API tester (please see [https://github.com/mautic/api-library/blob/master/apitester/index.php](https://github.com/mautic/api-library/blob/master/apitester/index.php)). I have tried regular Postman callback. Therefore I am not convinced, whether the documentation is valid.  
Variant with oAuth1: Authorized - when the lead is input into Mautic, I receive the error: “Invalid token”  
Variant with oAuth2: When authorized, I receive parameters code and state. This parameters should be later used for receiving own token. When I get accessToken, there is an error invalid\_grant and error message: “The authorization code has expired”. Unfortunately I haven’t received any parameters, yet.

Can you help with this one, please?

Thank you!

---

<div class="post-metadata">

**Author:** ![gugacavalieri](https://avatars.discourse-cdn.com/v4/letter/g/d26b3c/32.png) [@gugacavalieri](https://forum.mautic.org/u/gugacavalieri)\
**Post date:** [September 28, 2016, 9:39pm UTC](https://forum.mautic.org/t/invalid-token-errors-and-authorisation-error/3962/3 "2016-09-28T21:39:52Z")

</div>

Anyone?

Have the same problem over here !

---

<div class="post-metadata">

**Author:** ![michiellucas](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@michiellucas](https://forum.mautic.org/u/michiellucas)\
**Post date:** [November 9, 2016, 1:06pm UTC](https://forum.mautic.org/t/invalid-token-errors-and-authorisation-error/3962/4 "2016-11-09T13:06:32Z")

</div>

Having the same problem, did you find a solution?

---

<div class="post-metadata">

**Author:** ![michiellucas](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@michiellucas](https://forum.mautic.org/u/michiellucas)\
**Post date:** [November 9, 2016, 1:37pm UTC](https://forum.mautic.org/t/invalid-token-errors-and-authorisation-error/3962/5 "2016-11-09T13:37:53Z")

</div>

think i found the problem, i use the same key for multiple servers (local, dev and test)  
I need to create 1 key per server
