# Mautic Api library tutorial needed

**URL:** https://forum.mautic.org/t/mautic-api-library-tutorial-needed/4194
**Category:** General Discussion
**Created:** [June 27, 2016, 1:52am UTC](https://forum.mautic.org/t/mautic-api-library-tutorial-needed/4194 "2016-06-27T01:52:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![garena](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@garena](https://forum.mautic.org/u/garena)
#### Post date: [June 27, 2016, 1:52am UTC](https://forum.mautic.org/t/mautic-api-library-tutorial-needed/4194/1 "2016-06-27T01:52:09Z")

</div>

Is there any step by step tutorial for mautic api library  
  
How is the following code works??  
  
  
  
$leadApi = MauticApi::getContext(“leads”, $auth, $baseUrl.’/api/’);  
  
  
  
$fields = $leadApi-\>getFieldList();  
  
  
  
I want to use mautic api to retrieve or insert user data

---

<div class="post-metadata">

### Author: ![garena](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@garena](https://forum.mautic.org/u/garena)
#### Post date: [June 27, 2016, 1:52am UTC](https://forum.mautic.org/t/mautic-api-library-tutorial-needed/4194/2 "2016-06-27T01:52:09Z")

</div>

Is there any step by step tutorial for mautic api library  
How is the following code works??

$leadApi = MauticApi::getContext(“leads”, $auth, $baseUrl.’/api/’);

$fields = $leadApi-\>getFieldList();

I want to use mautic api to retrieve or insert user data

---

<div class="post-metadata">

### Author: ![garena](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@garena](https://forum.mautic.org/u/garena)
#### Post date: [June 27, 2016, 2:00am UTC](https://forum.mautic.org/t/mautic-api-library-tutorial-needed/4194/3 "2016-06-27T02:00:12Z")

</div>

How to do the correct callback for mautic api authorization?

[quote]I tried generate the api url to get access token, the url works in PostMan.  
I have no idea how MauticApi::getContext(); works…[/quote]

---

<div class="post-metadata">

### Author: ![erwindegrave](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/erwindegrave/32/1208_2.png) [@erwindegrave](https://forum.mautic.org/u/erwindegrave)
#### Post date: [June 27, 2016, 8:20am UTC](https://forum.mautic.org/t/mautic-api-library-tutorial-needed/4194/4 "2016-06-27T08:20:37Z")

</div>

I am also looking for a step by step Mautic API tutorial.

I have the authorization working (copied from somewhere on the web), but I cannot make any call to retrieve data. I am really stuck (being a novice programmer…)

Thanks,  
Erwin
