# For hosts with no Composer. How to add the API to a php script with require?

**URL:** <https://forum.mautic.org/t/for-hosts-with-no-composer-how-to-add-the-api-to-a-php-script-with-require/17380>\
**Category:** Product Support\
**Created:** [December 11, 2020, 10:24pm UTC](https://forum.mautic.org/t/for-hosts-with-no-composer-how-to-add-the-api-to-a-php-script-with-require/17380 "2020-12-11T22:24:15Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [September 19, 2021, 2:54pm UTC](https://forum.mautic.org/t/for-hosts-with-no-composer-how-to-add-the-api-to-a-php-script-with-require/17380/20 "2021-09-19T14:54:40Z")

</div>

@modifiedcontent

So I suggested you install it by cloning repository from github because it seems like the easiest way to me (I may have been wrong).

You actually do not re-install the CRM in real sesne, you just organize the whole project setup in a way, that you can easily mange the dependencies. I mean after all before I wrote you the answer I started out from simple source clone from github. But I understand that might not be the most convenient thing for you. The good news is that that should not be a deal breaker.

If you want to keep your source and your update process intact, you can just go and try to install mautic api library differently (again I do not know your situation, so this might not be suitable for you):

- Since you do not want to install mautic api library as part of existing “bundle” of dependencies, create another folder in mautic install called `lib`
- Move to folder lib
- Create composer.json file and put the following contents in:

```auto
{
  "require": {
    "mautic/api-library": "^3.0"
  },
}

```

- Now run composer install --no-dev

Api library should be installed inside vendor directory composer created.

Now take the script, I created above, make sure you fix the path to vendor/autoload.php file at the top and edit the rest of the things where you see string “YOURVALUE” and give it a go (I did not test this and might not be the most optimal solution, but you should be able to use api library as documented in github repository here: \< [GitHub - mautic/api-library: Mautic API Library](https://github.com/mautic/api-library) \>).

---

_[View the full topic](https://forum.mautic.org/t/for-hosts-with-no-composer-how-to-add-the-api-to-a-php-script-with-require/17380)._
