# Unable to get auth codes for OAuth2 api calls

**URL:** <https://forum.mautic.org/t/unable-to-get-auth-codes-for-oauth2-api-calls/4334>\
**Category:** Product Support\
**Created:** [June 8, 2016, 10:09am UTC](https://forum.mautic.org/t/unable-to-get-auth-codes-for-oauth2-api-calls/4334 "2016-06-08T10:09:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewrutter](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@andrewrutter](https://forum.mautic.org/u/andrewrutter)\
**Post date:** [June 8, 2016, 10:09am UTC](https://forum.mautic.org/t/unable-to-get-auth-codes-for-oauth2-api-calls/4334/1 "2016-06-08T10:09:02Z")

</div>

I am familiar with API development and OAuth specifically but running into some early issues trying to write backend integration to Mautic. I have a website (in Drupal 7) that is accepting user signups and some other email collection points. This data needs to be moved to a new Mautic installation to manage outbound campaigns. The process to do this against the old mail system was an hourly job to identify new signups and push them to the 3rd party. I am trying to replicate this using [https://github.com/mautic/api-library](https://github.com/mautic/api-library).  
  
  
  
I have the api enabled in settings and have defined a client for this cli process. My goal is to manually generate an initial auth and refresh token and then have the cli script manage any refresh, writing the tokens to a config file in case they change - which they will every hour or so.  
  
  
  
I am getting 404’s though when accessing the following URL which I pulled from [https://github.com/mautic/developer-documentation/blob/master/source/includes/\_api\_authorization\_oauth2.md](https://github.com/mautic/developer-documentation/blob/master/source/includes/_api_authorization_oauth2.md)  
  
  
  
/oauth/v2/authorize?client\_id=ID&grant\_type=authorization\_code&redirect\_uri=URL&response\_type=code  
  
Is using the API overkill for this level of internal integration and if so, is there an easier approach?

---

<div class="post-metadata">

**Author:** ![andrewrutter](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@andrewrutter](https://forum.mautic.org/u/andrewrutter)\
**Post date:** [June 8, 2016, 10:09am UTC](https://forum.mautic.org/t/unable-to-get-auth-codes-for-oauth2-api-calls/4334/2 "2016-06-08T10:09:02Z")

</div>

I am familiar with API development and OAuth specifically but running into some early issues trying to write backend integration to Mautic. I have a website (in Drupal 7) that is accepting user signups and some other email collection points. This data needs to be moved to a new Mautic installation to manage outbound campaigns. The process to do this against the old mail system was an hourly job to identify new signups and push them to the 3rd party. I am trying to replicate this using [https://github.com/mautic/api-library](https://github.com/mautic/api-library).

I have the api enabled in settings and have defined a client for this cli process. My goal is to manually generate an initial auth and refresh token and then have the cli script manage any refresh, writing the tokens to a config file in case they change - which they will every hour or so.

I am getting 404’s though when accessing the following URL which I pulled from [https://github.com/mautic/developer-documentation/blob/master/source/includes/\_api\_authorization\_oauth2.md](https://github.com/mautic/developer-documentation/blob/master/source/includes/_api_authorization_oauth2.md)

/oauth/v2/authorize?client\_id=ID&grant\_type=authorization\_code&redirect\_uri=URL&response\_type=code  
Is using the API overkill for this level of internal integration and if so, is there an easier approach?

---

<div class="post-metadata">

**Author:** ![kinnaert](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@kinnaert](https://forum.mautic.org/u/kinnaert)\
**Post date:** [August 25, 2016, 3:38pm UTC](https://forum.mautic.org/t/unable-to-get-auth-codes-for-oauth2-api-calls/4334/3 "2016-08-25T15:38:34Z")

</div>

I get error also when it tries to go to /oauth/v2/authorize? I get HTTP 403, I’ve installed API library i.e /lib folder from github but still get this error
