# Calling Mautic API?

**URL:** https://forum.mautic.org/t/calling-mautic-api/1788
**Category:** Product Support
**Created:** [April 30, 2015, 1:47pm UTC](https://forum.mautic.org/t/calling-mautic-api/1788 "2015-04-30T13:47:16Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![karibu](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@karibu](https://forum.mautic.org/u/karibu)
#### Post date: [April 30, 2015, 1:47pm UTC](https://forum.mautic.org/t/calling-mautic-api/1788/1 "2015-04-30T13:47:16Z")

</div>

Hi guys,  
  
  
  
I’d like to link Mautic with our website (Ruby and Rails) to ensure all the new registration are added to our Mautic leads pool.  
  
  
  
However we were not able to find the documentation on how to call the API.  
  
  
  
I only found the API PHP Library [https://github.com/mautic/api-library](https://github.com/mautic/api-library)  
  
  
  
Any idea where I can find it?  
  
  
  
Thanks

---

<div class="post-metadata">

### Author: ![karibu](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@karibu](https://forum.mautic.org/u/karibu)
#### Post date: [April 30, 2015, 1:47pm UTC](https://forum.mautic.org/t/calling-mautic-api/1788/2 "2015-04-30T13:47:16Z")

</div>

Hi guys,

I’d like to link Mautic with our website (Ruby and Rails) to ensure all the new registration are added to our Mautic leads pool.

However we were not able to find the documentation on how to call the API.

I only found the API PHP Library [https://github.com/mautic/api-library](https://github.com/mautic/api-library)

Any idea where I can find it?

Thanks

---

<div class="post-metadata">

### Author: ![chad.windnagle](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@chad.windnagle](https://forum.mautic.org/u/chad.windnagle)
#### Post date: [April 30, 2015, 7:29pm UTC](https://forum.mautic.org/t/calling-mautic-api/1788/3 "2015-04-30T19:29:38Z")

</div>

Hi Karibu

There isn’t any documentation published on the API yet - but here’s some basic guidelines:

1. You’ll need to enable the API in Mautic and turn on the Oauth authentication, and generate API keys.

2. You’ll need to authenticate the app to Mautic using the Oauth process.

The process is mostly documented on the github repo under ‘authorization’.

After that you’ll need to use the create lead endpoints. See the ‘creating an item’ section of the github repo readme for the API for sample code on that.

Finally - if you want to actual code to look at, any of our CMS plugins would be good. So:

Authorize function:  
[https://github.com/mautic/mautic-joomla/blob/master/mautic.php#L240](https://github.com/mautic/mautic-joomla/blob/master/mautic.php#L240)

Create new lead:  
[https://github.com/mautic/mautic-joomla/blob/master/mautic.php#L296](https://github.com/mautic/mautic-joomla/blob/master/mautic.php#L296)

Unfortunately all the examples are in PHP, but the Oauth logic process will be the same in Ruby and all you’ll need to do is translate the php functions to Ruby.

Definitely let us know how it turns out. We’d love to see some sample code in Ruby!

---

<div class="post-metadata">

### Author: ![karibu](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@karibu](https://forum.mautic.org/u/karibu)
#### Post date: [May 20, 2015, 1:30pm UTC](https://forum.mautic.org/t/calling-mautic-api/1788/4 "2015-05-20T13:30:07Z")

</div>

Hi guys,

Our dev will be looking into it soon but he expect some documentation or examples on how to call the API to speed up his work (As he has many features to implement on others parts of our project).

Did anyone there have been successful with Mautic API with Ruby? Any sample code or good practices?

Thank you!

---

<div class="post-metadata">

### Author: ![chad.windnagle](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@chad.windnagle](https://forum.mautic.org/u/chad.windnagle)
#### Post date: [May 25, 2015, 5:48pm UTC](https://forum.mautic.org/t/calling-mautic-api/1788/5 "2015-05-25T17:48:57Z")

</div>

Hi Karibu

Not sure if this will help any more but here’s a list of all the end points:

[https://github.com/mautic/api-library/tree/master/apitester/endpoints](https://github.com/mautic/api-library/tree/master/apitester/endpoints)

And the only thing missing there is the http verbs, which are here:

[https://github.com/mautic/api-library#get-a-context-object](https://github.com/mautic/api-library#get-a-context-object)

That’ll just be get / post for read/write.

---

<div class="post-metadata">

### Author: ![kartikluke](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@kartikluke](https://forum.mautic.org/u/kartikluke)
#### Post date: [December 21, 2015, 5:52pm UTC](https://forum.mautic.org/t/calling-mautic-api/1788/6 "2015-12-21T17:52:10Z")

</div>

Hey @karibu I’m looking to use Mautic on a Ruby on Rails application. Is it possible for you to open source your implementation of the Mautic API wrapper in Ruby, any help would be appreciated. I’m sure a lot of people from the Rails community would like to use Mautic as well.

---

<div class="post-metadata">

### Author: ![kartikluke](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@kartikluke](https://forum.mautic.org/u/kartikluke)
#### Post date: [December 21, 2015, 5:52pm UTC](https://forum.mautic.org/t/calling-mautic-api/1788/7 "2015-12-21T17:52:45Z")

</div>

If we could help make an official Ruby wrapper of the API that would be awesome.

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [February 2, 2020, 10:56pm UTC](https://forum.mautic.org/t/calling-mautic-api/1788/8 "2020-02-02T22:56:18Z")

</div>


