# How to map returned parametres to what API documentation says?

**URL:** https://forum.mautic.org/t/how-to-map-returned-parametres-to-what-api-documentation-says/5901
**Category:** Product Support
**Created:** [February 24, 2016, 6:00pm UTC](https://forum.mautic.org/t/how-to-map-returned-parametres-to-what-api-documentation-says/5901 "2016-02-24T18:00:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tasselhof](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@tasselhof](https://forum.mautic.org/u/tasselhof)
#### Post date: [February 24, 2016, 6:00pm UTC](https://forum.mautic.org/t/how-to-map-returned-parametres-to-what-api-documentation-says/5901/1 "2016-02-24T18:00:31Z")

</div>

In [API documentation](https://github.com/mautic/api-library/blob/master/README.md), it is simply stated that:

Code:

/\* // If you already have the access token, et al, pass them in as well to prevent the need for reauthorization $settings['accessToken'] = $accessToken; $settings['accessTokenSecret'] = $accessTokenSecret; //for OAuth1.0a $settings['accessTokenExpires'] = $accessTokenExpires; //UNIX timestamp $settings['refreshToken'] = $refreshToken; \*/

  
I have PHP script, which calls mautic and then mautic calls the script itself. I finally figured out how to make mautic write something else than "Callback is not valid." Now I am facing bigger issue. When the script is called again when returning from mautic, all I can see is this:  
  
When returned back, I have two new GET parametres. Example:  

Code:

oauth\_token = 5maxsedwvz8k08oc4s4sggscggk04c808owg4kocg4c48kwc8s oauth\_verifier = 2gdxm0o4ylgkgkgwssws48o80w8wsw0ckokgk0gg4gw44o88g8

  
I looked into HTTP headers in mozilla web developers tools and found nothing.  
  
So, I give up and ask here: How should I map the above two GET parameters to the four what the API documentation says?

---

<div class="post-metadata">

### Author: ![tasselhof](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@tasselhof](https://forum.mautic.org/u/tasselhof)
#### Post date: [February 24, 2016, 6:00pm UTC](https://forum.mautic.org/t/how-to-map-returned-parametres-to-what-api-documentation-says/5901/2 "2016-02-24T18:00:31Z")

</div>

In [API documentation](https://github.com/mautic/api-library/blob/master/README.md), it is simply stated that:

```auto
/*
// If you already have the access token, et al, pass them in as well to prevent the need for reauthorization
$settings['accessToken'] = $accessToken;
$settings['accessTokenSecret'] = $accessTokenSecret; //for OAuth1.0a
$settings['accessTokenExpires'] = $accessTokenExpires; //UNIX timestamp
$settings['refreshToken'] = $refreshToken;
*/
```

I have PHP script, which calls mautic and then mautic calls the script itself. I finally figured out how to make mautic write something else than “Callback is not valid.” Now I am facing bigger issue. When the script is called again when returning from mautic, all I can see is this:

When returned back, I have two new GET parametres. Example:

```auto
oauth_token = 5maxsedwvz8k08oc4s4sggscggk04c808owg4kocg4c48kwc8s
oauth_verifier = 2gdxm0o4ylgkgkgwssws48o80w8wsw0ckokgk0gg4gw44o88g8
```

I looked into HTTP headers in mozilla web developers tools and found nothing.

So, I give up and ask here: How should I map the above two GET parameters to the four what the API documentation says?

---

<div class="post-metadata">

### Author: ![tasselhof](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@tasselhof](https://forum.mautic.org/u/tasselhof)
#### Post date: [February 26, 2016, 9:16am UTC](https://forum.mautic.org/t/how-to-map-returned-parametres-to-what-api-documentation-says/5901/3 "2016-02-26T09:16:16Z")

</div>

bump

---

<div class="post-metadata">

### Author: ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)
#### Post date: [March 3, 2016, 11:23am UTC](https://forum.mautic.org/t/how-to-map-returned-parametres-to-what-api-documentation-says/5901/4 "2016-03-03T11:23:06Z")

</div>

You didn’t specify what version of OAuth are you using. If you look a little deeper to the code example you are quoting:

```auto
    // $accessTokenData will have the following keys:
    // For OAuth1.0a: access_token, access_token_secret, expires
    // For OAuth2: access_token, expires, token_type, refresh_token
```

To answer your question, `oauth_token` is `accessToken` and `oauth_verifier` is `accessTokenSecret` for OAuth1.0a. Is that clear now?

BTW, check also [https://developer.mautic.org/#rest-api](https://developer.mautic.org/#rest-api)
