PHPackages                             smarkio/smarkio-api-client - 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. smarkio/smarkio-api-client

ActiveLibrary[API Development](/categories/api)

smarkio/smarkio-api-client
==========================

Accelerator to communicate with the Smark.io Internal API

2.0.0(10y ago)191MITPHP

Since Oct 8Pushed 10y ago27 watchersCompare

[ Source](https://github.com/smarkio/smarkio-api-client)[ Packagist](https://packagist.org/packages/smarkio/smarkio-api-client)[ Docs](https://github.com/smarkio/smarkio-api-client)[ RSS](/packages/smarkio-smarkio-api-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

\#Smark.io API
==============

[](#smarkio-api)

An accelerator to communicate with © Smark.io API to manage Lead Relations

Installation and usage with Composer
------------------------------------

[](#installation-and-usage-with-composer)

Add the following to your composer.json file in order to fetch the latest stable version of the project:

```
{
    "require": {
        "smarkio/smarkio-api-client": "*"
    }
}
```

Then, in order to use the accelerator on your own PHP file, add the following:

```
require '[COMPOSER_VENDOR_PATH]/autoload.php';
```

Contents
--------

[](#contents)

- src/Smarkio/API - Code to interact with the Smarkio Internal API.
- examples/ - Some examples on how to use this accelerator.

Before you start
----------------

[](#before-you-start)

You need to obtain one API token to use the API. This token is bound to each user of the Smark.io system details.

Usage
=====

[](#usage)

Create a Lead Relation
----------------------

[](#create-a-lead-relation)

```
$api_token = 'YOUR API TOKEN HERE';
$my_smarkio_url = 'YOUR SMARK.IO URL HERE';

//The ID of the first lead of the relation
$originId = '359680';

//The ID of the second lead of the relation
$destinyId = '359670';

//Slug of the relation type
$type = 'family';

//Operation of the API, in this case to create a Lead Relation
$operation = 'add';

// create Relation
$relation = new Relation($originId, $destinyId, $type, $api_token);

// send the request
$response = $relation->send($operation,$my_smarkio_url);
```

Delete a Lead Relation
----------------------

[](#delete-a-lead-relation)

```
$api_token = 'YOUR API TOKEN HERE';
$my_smarkio_url = 'YOUR SMARK.IO URL HERE';

//The ID of the first lead of the relation
$originId = '359680';

//The ID of the second lead of the relation
$destinyId = '359670';

//Slug of the relation type
$type = 'family';

//Operation of the API, in this case to delete a Lead Relation
$operation = 'delete';

// create Relation
$relation = new Relation($originId, $destinyId, $type, $api_token);

// send the request
$response = $relation->send($operation,$my_smarkio_url);
```

Get a Lead by ID
----------------

[](#get-a-lead-by-id)

```
$api_token = 'YOUR API TOKEN HERE';
$my_smarkio_url = 'YOUR SMARK.IO URL HERE';

// The id of the lead
$my_lead_id = 36;

$lead_api = new \Smarkio\API\LeadAPI($api_token, $my_smarkio_url);
$lead = $lead_api->getLead($my_lead_id);
```

Search Leads
------------

[](#search-leads)

```
$api_token = 'YOUR API TOKEN HERE';
$my_smarkio_url = 'YOUR SMARK.IO URL HERE';

$lead_api = new \Smarkio\API\LeadAPI($api_token, $my_smarkio_url);

// Parameters to filter the Search
// If null use defaults
$parameters = array(
    'id_min'               => null, // eg: 123
    'id_max'               => null, // eg: 999
    'creation_date_min'    => null, // eg: '2015-07-01'
    'creation_date_max'    => null, // eg: '2015-07-31'
    'integration_date_min' => null, // eg: '2015-07-01'
    'integration_date_max' => null, // eg: '2015-07-31'
    'limit'                => null, // eg: 100
    'offset'               => null  // eg: 0
)

// Get the paginated results
$paginated_leads = $lead_api->searchLead($parameters);
$continue_processing = true;

// Get all the pages
while ($continue_processing) {
    $leads = $paginated_leads->getLeads();

    // Do something with the leads ...

    $continue_processing = $paginated_leads->hasNext();
    if ( $continue_processing ) {
        // Get the next results
        $paginated_leads = $paginated_leads->next();
    }
}
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~315 days

Total

2

Last Release

3923d ago

Major Versions

1.0.0 → 2.0.02015-08-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/78048ae9e61dbef99ac702acb4a6194da75c2c1b6c92fe23eea6ae3a45ec3b20?d=identicon)[developers@smark.io](/maintainers/developers@smark.io)

---

Top Contributors

[![Highvolt](https://avatars.githubusercontent.com/u/182139?v=4)](https://github.com/Highvolt "Highvolt (5 commits)")[![adc-pamaral](https://avatars.githubusercontent.com/u/5681250?v=4)](https://github.com/adc-pamaral "adc-pamaral (3 commits)")[![marcosdd](https://avatars.githubusercontent.com/u/10602309?v=4)](https://github.com/marcosdd "marcosdd (2 commits)")[![ruicampos](https://avatars.githubusercontent.com/u/1894978?v=4)](https://github.com/ruicampos "ruicampos (2 commits)")[![escudeiro](https://avatars.githubusercontent.com/u/5419607?v=4)](https://github.com/escudeiro "escudeiro (1 commits)")

---

Tags

apileadsmarkio

### Embed Badge

![Health badge](/badges/smarkio-smarkio-api-client/health.svg)

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

###  Alternatives

[teepluss/api

Laravel 4 Internal Request (HMVC)

7034.0k](/packages/teepluss-api)[dan/shopify-api

Shopify API for PHP

218.1k](/packages/dan-shopify-api)

PHPackages © 2026

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