PHPackages                             kirianmurgadella/restapimanager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. kirianmurgadella/restapimanager

ActiveLibrary[API Development](/categories/api)

kirianmurgadella/restapimanager
===============================

Library to manage calls to a Rest API

1.3.0(7y ago)06291PHPPHP &gt;=7.0

Since Jul 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/KirianM/restapimanager)[ Packagist](https://packagist.org/packages/kirianmurgadella/restapimanager)[ RSS](/packages/kirianmurgadella-restapimanager/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (7)Used By (1)

Rest API Manager
================

[](#rest-api-manager)

A little library to interact with any Rest API.

Installation
------------

[](#installation)

```
composer require kirianmurgadella/restapimanager

```

How to use it
-------------

[](#how-to-use-it)

### Initialize ApiManager

[](#initialize-apimanager)

#### API without authentication

[](#api-without-authentication)

Create a new instance of ApiManager using its factory.

```
$apiManager = ApiManagerFactory::create('https://api-url.com');

```

#### API with authentication

[](#api-with-authentication)

**This package works with: [JSON Web Token](https://es.wikipedia.org/wiki/JSON_Web_Token) and [HTTP Basic Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication)**

##### Create a new instance for your authentication using its factory

[](#create-a-new-instance-for-your-authentication-using-its-factory)

###### With JWT

[](#with-jwt)

```
$credentials = [
    'email' => 'myemail@domain.com',
    'password' => 'mypassword'
];
$apiLoginUrl = 'https://api-url.com/login';
$apiTokenRequestUrl = 'https://api-url.com/request-token';
$auth = Auth\AuthFactory::create('jwt', $credentials, $apiLoginUrl, $apiTokenRequestUrl);

```

###### With BA

[](#with-ba)

```
$credentials = [
    'username' => 'myusername',
    'password' => 'mypassword'
];
$auth = Auth\AuthFactory::create('basic', $credentials);

```

##### Create a new instance of ApiManager using its factory

[](#create-a-new-instance-of-apimanager-using-its-factory)

```
$apiManager = ApiManagerFactory::create('https://api-url.com', $auth);

```

### Use ApiManager

[](#use-apimanager)

```
    $apiManager->get('api/get/endpoint', ['custom headers']);
    $apiManager->post('api/post/endpoint', ['request data'], ['custom headers']);
    $apiManager->put('api/put/endpoint', ['request data'], ['custom headers']);
    $apiManager->request('custom method', 'api/custom/endpoint', ['request data'], ['custom headers']);

```

### Response

[](#response)

Every response will have the same structure

```
[
    'status' => 'success/error',
    'statusCode => 'XXX',
    'data' => [],
    'errors' => [
        [...],
        [...],
        [...]
    ]
]

```

- **status**: Contains success if everything goes well or **error** if something failed.
- **statusCode**: Will be the HTTP Status from the cURL request.
- **data**: It has the response of the request. **Here is whatever you asked for**.
- **errors**: You want it empty, but at least it will tell you what failed.

Changelog
---------

[](#changelog)

**1.3.0**

- Added Http Basic Authentication

**1.2.0**

- Fixed ApiManagerFactory namespace.
- Fixed ApiManagerFactory uses.

**1.1.0**

- Added DELETE method.

**1.0.0**

- Basic API interaction (GET, POST, PUT).
- Implemented [JSON Web Token](https://es.wikipedia.org/wiki/JSON_Web_Token) authentication.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

6

Last Release

2838d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eab579f7313ef3c412ab7fbd21589a37c7bd4ddedabc56648e242e354252010d?d=identicon)[kmurgadella](/maintainers/kmurgadella)

---

Top Contributors

[![KirianM](https://avatars.githubusercontent.com/u/844565?v=4)](https://github.com/KirianM "KirianM (34 commits)")

---

Tags

phprest-api

### Embed Badge

![Health badge](/badges/kirianmurgadella-restapimanager/health.svg)

```
[![Health](https://phpackages.com/badges/kirianmurgadella-restapimanager/health.svg)](https://phpackages.com/packages/kirianmurgadella-restapimanager)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
