PHPackages                             digitonic/mdoc-api - 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. digitonic/mdoc-api

AbandonedArchivedLibrary[API Development](/categories/api)

digitonic/mdoc-api
==================

A Framework Agnostic PHP SDK to interact with the mDoc API.

0.1.0(7y ago)024MITPHPPHP ^7.2

Since Jun 20Pushed 7y ago4 watchersCompare

[ Source](https://github.com/digitonic/mdoc-api)[ Packagist](https://packagist.org/packages/digitonic/mdoc-api)[ Docs](https://github.com/digitonic/mdoc-api)[ RSS](/packages/digitonic-mdoc-api/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

mDoc API SDK
============

[](#mdoc-api-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/68832810e3d9eaa4733dce616af506c3f94eeda63b6a618811cd14fcf57ad875/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64696769746f6e69632f6d646f632d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/digitonic/mdoc-api)[![Code Coverage](https://camo.githubusercontent.com/b1a46d7c8c3c49f2c81904388ee131f8de1a0d7e24c9f70e3f4296f6808293ad/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64696769746f6e69632f6d646f632d6170692f6261646765732f636f7665726167652e706e673f623d6d617374657226733d66663232643536313937303331356138313063666436623736646630353239343166383139343462)](https://scrutinizer-ci.com/g/digitonic/mdoc-api/?branch=master)[![Build Status](https://camo.githubusercontent.com/fd28e666369ca0faf406ecc2b83ab5cb502f7a7040bb476f65df3d2c50652878/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64696769746f6e69632f6d646f632d6170692f6261646765732f6275696c642e706e673f623d6d617374657226733d66353563636431393334623038376365313963626565316165313462313737383235316235623838)](https://scrutinizer-ci.com/g/digitonic/mdoc-api/build-status/master)[![Code Quality](https://camo.githubusercontent.com/b743a1993a77fca9fae523c231c8f1af7beb201c96f9bdd5f8da1ad269ca4586/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64696769746f6e69632f6d646f632d6170692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d617374657226733d64326235366436353762643432616462333363653831323138313930306338376464323236393066)](https://scrutinizer-ci.com/g/digitonic/mdoc-api/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/77ab18c5232363a52c23a557fc0a59de6f272b6e138af69913c4c6bb8d9be436/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64696769746f6e69632f6d646f632d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/digitonic/mdoc-api)

This is the official Framework Agnostic PHP SDK to interact with the mDoc API. Although framework agnostic by nature, the package also includes configurations for working in Laravel.

Package is currently in heavy development, be careful of use in production
==========================================================================

[](#package-is-currently-in-heavy-development-be-careful-of-use-in-production)

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

[](#installation)

You can install the package via composer:

```
composer require digitonic/mdoc-api
```

Usage
-----

[](#usage)

### Framework Agnostic Usage

[](#framework-agnostic-usage)

**Please Note: You must obtain your API key from your account profile**

```
$baseUrl = 'https://mdoc.it/api/1.0/';
$apiKey = 'KxDMt9GNVgu6fJUOG0UjH3d4kjZPTxFiXd5RnPhUD8Qz1Q2esNVIFfqmrqgB';
```

```
    // Instantiate a new Guzzle client
    $guzzle = new \GuzzleHttp\Client([
        'base_uri' => $baseUrl,
        'headers' => [
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer ' . $apiKey
        ],
    ]);
```

```
    // Instantiate a new mDoc API client with the Guzzle dependency.
    $mdocApi = new \Digitonic\MdocApi\Client($guzzle)
```

The mDoc API client can now be used as a dependency for communicating with various endpoints. for example, to get a list of all teams available to the API use you can use the following -

```
    $listTeams = new Digitonic\MdocApi\Teams\ListAllTeams($mdocApi);
    $response = $listTeams->send();

    print_r($response);
```

All endpoints that return data will return data as a `\Illuminate\Support\Collection`. This will provide various utility methods when searching the response. For more information on Laravel Collections see . Please note, this package does not require the full Laravel framework to be used.

```
Collection {#548 ▼
  #items: array:2 [▼
    "data" => array:3 [▼
      0 => {#597 ▼
        +"uuid": "45bdd45e-59e4-11e9-a656-0a586460061d"
        +"name": "Test Team 1"
        +"owner": "87671060-4f20-11e9-8e5f-0a5864600621"
        +"created_at": "2019-04-08 10:54:16"
        +"updated_at": "2019-04-08 10:54:16"
      }
      1 => {#595 ▼
        +"uuid": "cb886c4c-4f1d-11e9-b27f-0a5864600621"
        +"name": "Test Team 2"
        +"owner": "bea63aea-4f1d-11e9-a775-0a5864600621"
        +"created_at": "2019-03-25 16:48:19"
        +"updated_at": "2019-04-18 11:42:11"
      }
      2 => {#598 ▼
        +"uuid": "77f98560-5b76-11e9-8a31-0a5864600906"
        +"name": "Test Team 3"
        +"owner": "19bca08a-5b72-11e9-a205-0a586460090b"
        +"created_at": "2019-04-10 10:53:18"
        +"updated_at": "2019-04-10 10:53:18"
      }
    ]
    "meta" => {#585 ▼
      +"pagination": {#586 ▼
        +"total": 3
        +"count": 3
        +"per_page": 15
        +"current_page": 1
        +"total_pages": 1
        +"links": []
      }
    }
  ]
}
```

### Laravel Usage

[](#laravel-usage)

In Laravel &gt;5.5 the package will auto register the service provider. In Laravel &lt;5.5 you must install this service provider.

```
// config/app.php
'providers' => [
    ...
    Digitonic\MdocApi\MdocApiServiceProvider::class,
    ...
];
```

In Laravel &gt;5.5 the package will auto register the facades. In Laravel &lt;5.5 you must install **all** facades manually.

```
// config/app.php
'aliases' => [
    ...
    'ListAllTeams' => Digitonic\MdocApi\Facades\Teams\ListAllTeams::class,
    'CampaignCreate'=> Digitonic\MdocApi\Facades\Campaigns\Create::class
    ...
];
```

You can publish the config file of this package with this command:

```
php artisan vendor:publish --provider="Digitonic\MdocApi\MdocApiServiceProvider"
```

The following config file will be published in `config/mdoc-api.php`

```
return [
    'base_url' => env('MDOC_BASE_URL', 'https://mdoc.it/api/1.0/'),

    'api_key' => env('MDOC_API_KEY', ''),
];
```

#### IoC container

[](#ioc-container)

The IoC container will automatically resolve the `MdocApi` dependencies for you when calling any endpoint. Which means you can just type hint your endpoint to retrieve the object from the container with all configurations in place.

```
// From a constructor
class FooClass {
    public function __construct(Digitonic\MdocApi\Teams\ListAllTeams $listTeams) {
       $listTeams->send();
    }
}

// From a method
class BarClass {
    public function barMethod(Digitonic\MdocApi\Teams\ListAllTeams $listTeams) {
       $listTeams->send();
    }
}
```

Alternatively you may use the facades directly

```
    ListAllTeams:send();
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Steven Richardson](https://github.com/digitonic)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2567d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104549?v=4)[Steven Richardson](/maintainers/richdynamix)[@richdynamix](https://github.com/richdynamix)

---

Tags

digitonicmdoc-api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/digitonic-mdoc-api/health.svg)

```
[![Health](https://phpackages.com/badges/digitonic-mdoc-api/health.svg)](https://phpackages.com/packages/digitonic-mdoc-api)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.1k1](/packages/jasara-php-amzn-selling-partner-api)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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