# REST API for 4.0.2 not working

**URL:** <https://forum.mautic.org/t/rest-api-for-4-0-2-not-working/22953>\
**Category:** Mautic 4 Install/Upgrade Support\
**Tags:** community, discussion, development\
**Created:** [March 8, 2022, 7:56am UTC](https://forum.mautic.org/t/rest-api-for-4-0-2-not-working/22953 "2022-03-08T07:56:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubropurkait](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shubropurkait/32/6974_2.png) [@shubropurkait](https://forum.mautic.org/u/shubropurkait)\
**Post date:** [March 8, 2022, 7:56am UTC](https://forum.mautic.org/t/rest-api-for-4-0-2-not-working/22953/1 "2022-03-08T07:56:14Z")

</div>

**Your software**  
My Mautic version is: 4.0.2  
_My PHP version is_ : 7 (Laravel 7 framework)  
_My MySQL/MariaDB version is_ (delete as applicable): MySQL/MariaDB version

**Installing Errors**  
\*I am new to mautic : Installing  
\*Upgrading/installing via : Command Line (VS code IDE)

_My problem is_ :  
[https://Domain/?state=STATE\_CODE&code=](https://Domain/?state=STATE_CODE&code=)_CODE_

postman test for : [https://Domain/api/contacts?code=](https://Domain/api/contacts?code=)_CODE_  
{

```
"errors": [

    {

        "message": "The access token provided is invalid.",

        "code": 401,

        "type": "invalid_grant"

    }

]

```

}

please help me to add contacts from database and also to retrieve from API
