# Mautic VPS integration doesn't works with my sass system

**URL:** https://forum.mautic.org/t/mautic-vps-integration-doesnt-works-with-my-sass-system/4279
**Category:** Product Support
**Created:** [June 21, 2016, 11:36am UTC](https://forum.mautic.org/t/mautic-vps-integration-doesnt-works-with-my-sass-system/4279 "2016-06-21T11:36:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tigredonorte](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@tigredonorte](https://forum.mautic.org/u/tigredonorte)
#### Post date: [June 21, 2016, 11:36am UTC](https://forum.mautic.org/t/mautic-vps-integration-doesnt-works-with-my-sass-system/4279/1 "2016-06-21T11:36:39Z")

</div>

Hello everyone!  
  
I trying integrate mautic with my sass system (for send contacts, tags, etc).  
  
I installed mautic in VPS.  
  
My system is built in PHP, so i use this mautic repo [https://github.com/mautic/api-library](https://github.com/mautic/api-library)  
  
But the follow code doesn’t works:

Code:

//defines define('MYBASEURL', 'http://url-to-mautic-instance'); define('MYCLIENT\_KEY', 'SOME\_OAUTH2\_KEY'); define('MYCLIENT\_SECRET', 'SOME\_OAUTH2\_SECRET');

// Initiate the auth object  
$auth = ApiAuth::initiate(array(  
‘baseUrl’ =\> MYBASEURL,  
‘version’ =\> ‘OAuth2’,  
‘clientKey’ =\> MYCLIENT\_KEY,  
‘clientSecret’ =\> MYCLIENT\_SECRET,  
‘callback’ =\> ‘[startinvestimentos.com/mautic\_test](http://startinvestimentos.com/mautic_test)’  
));

try{  
if ($auth-\>validateAccessToken()) {  
if ($auth-\>accessTokenUpdated()) {  
$accessTokenData = $auth-\>getAccessTokenData();  
//store access token data however you want  
}  
}  
echo ‘ok’;  
} catch (Exception $ex) {  
echo ‘erro’;  
}

  
When i run it i was redirected to mymautic\_url/oauth/v2/authorize, but page has 403 error (forbidden)  
  
Someone knows what should i do for my code works?

---

<div class="post-metadata">

### Author: ![tigredonorte](https://avatars.discourse-cdn.com/v4/letter/t/d2c977/32.png) [@tigredonorte](https://forum.mautic.org/u/tigredonorte)
#### Post date: [June 21, 2016, 11:36am UTC](https://forum.mautic.org/t/mautic-vps-integration-doesnt-works-with-my-sass-system/4279/2 "2016-06-21T11:36:39Z")

</div>

Hello everyone!  
I trying integrate mautic with my sass system (for send contacts, tags, etc).  
I installed mautic in VPS.  
My system is built in PHP, so i use this mautic repo [https://github.com/mautic/api-library](https://github.com/mautic/api-library)  
But the follow code doesn’t works:

```auto
//defines
define('MYBASEURL', 'http://url-to-mautic-instance');
define('MYCLIENT_KEY', 'SOME_OAUTH2_KEY');
define('MYCLIENT_SECRET', 'SOME_OAUTH2_SECRET');

// Initiate the auth object
$auth = ApiAuth::initiate(array(
      'baseUrl' => MYBASEURL,
      'version' => 'OAuth2',
      'clientKey' => MYCLIENT_KEY,
      'clientSecret' => MYCLIENT_SECRET, 
      'callback' => 'startinvestimentos.com/mautic_test'
));

try{
      if ($auth->validateAccessToken()) {
            if ($auth->accessTokenUpdated()) {
                  $accessTokenData = $auth->getAccessTokenData();
                  //store access token data however you want
            }
      }
      echo 'ok';
} catch (Exception $ex) {
      echo 'erro';
}
```

When i run it i was redirected to mymautic\_url/oauth/v2/authorize, but page has 403 error (forbidden)

Someone knows what should i do for my code works?
