PHPackages                             10quality/salsa-api-php - 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. 10quality/salsa-api-php

ActiveLibrary[API Development](/categories/api)

10quality/salsa-api-php
=======================

Salsa API wrapper/handler for PHP.

v1.0.1(8y ago)074MITPHPPHP &gt;=5.4

Since Mar 31Pushed 8y ago1 watchersCompare

[ Source](https://github.com/10quality/salsa-api-php)[ Packagist](https://packagist.org/packages/10quality/salsa-api-php)[ RSS](/packages/10quality-salsa-api-php/feed)WikiDiscussions v1.0 Synced 2mo ago

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

Salsa API (PHP)
===============

[](#salsa-api-php)

[![Latest Stable Version](https://camo.githubusercontent.com/b6080cafffceda15e73c3f400ff35f70bae3c7691f0726084f8f456fa2b033d6/68747470733a2f2f706f7365722e707567782e6f72672f31307175616c6974792f73616c73612d6170692d7068702f762f737461626c65)](https://packagist.org/packages/10quality/salsa-api-php)[![Total Downloads](https://camo.githubusercontent.com/6825c963cdc47e3f0000ea73fa98eee4e0879be621e0862b50794036655038de/68747470733a2f2f706f7365722e707567782e6f72672f31307175616c6974792f73616c73612d6170692d7068702f646f776e6c6f616473)](https://packagist.org/packages/10quality/salsa-api-php)[![License](https://camo.githubusercontent.com/f993c82e28d641be8767e293210d9340c31669148a7bc8794e05be753357d8e9/68747470733a2f2f706f7365722e707567782e6f72672f31307175616c6974792f73616c73612d6170692d7068702f6c6963656e7365)](https://packagist.org/packages/10quality/salsa-api-php)

[Salsa](https://help.salsalabs.com/hc/en-us) API wrapper/handler for PHP.

Scope
-----

[](#scope)

Current supporting end-points:

- Metrics
- Supporters

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

[](#installation)

With composer, make the dependecy required in your project:

```
composer require 10quality/salsa-api-php
```

Usage
-----

[](#usage)

Initialize the API instance:

```
use Salsa\Api;

$api = Api::instance([
    'token'     => '..YOUR-ACCESS-TOKEN..',
    'env'       => 'live', // For development change to 'sandbox'
    'sandbox'   => 'https://sandbox.salsalabs.com/' // Sandbox environment custom base URL.
]);
```

### Metrics endpoint

[](#metrics-endpoint)

Next shows how to get metrics from Salsa:

```
use Salsa\Metrics;

$endpoint = new Metrics($api);

// Retrieve metrics response
$response = $endpoint->get();

// A specific metric
echo $endpoint->get()->payload->totalAPICalls;
```

### Supporters endpoint

[](#supporters-endpoint)

Next sample shows how to search for supporters:

```
use Salsa\Supporters;

$endpoint = new Supporters($api);

// Search for supporters
$response = $endpoint->searchByEmail('an-email@domain.com');
$response = $endpoint->searchByEmails(['an-email@domain.com', 'second-email@domain.com']);

// Retrieve supporters from response
print_r($response->supporters);
```

Next sample shows how to create/update a new supporter:

```
use Salsa\Supporters;
use Salsa\Models\Supporter;

// Define the endpoint
$endpoint = new Supporters($api);

// Create supporter using model
$supporter = new Supporter;
$supporter->email = 'an-email@domain.com';
$supporter->title = 'Mr';
$supporter->firstName = 'Alejandro';
$supporter->lastName = 'Mostajo';
$supporter->address = [
    'line1' => 'Alice in wonderland',
    'line2' => 'In the books',
    'city'  => 'San Diego',
    'state' => 'CA',
    'postalCode' => '99999',
    'county' => 'CA',
    'country' => 'US',
];
$supporter->dateOfBirth = '2017-01-01';
// Phones
$supporter->cellphone = '1234567890';
$supporter->workphone = '1234567890';
$supporter->homephone = '1234567890';
// Custom fields
$supporter->addCustomField(
    null, // Field ID
    'Nickname', // Field Name
    'Piru', // Value
    null // Type
);

// Add supporter
$response = $endpoint->update($supporter);

// Get updated supporters with their Salsa Supporter ID
$response->supporters;

// Add multiple supporters
$response = $endpoint->updateBatch([$supporter, $supporter2]);
```

**NOTE:** Supporter models must include property `supporterId` in order to be updated.

**NOTE:** Custom fields types: STRING, NUMBER, DATE, TIMESTAMP, BOOL.

Next sample shows how to delete an existint supporter:

```
use Salsa\Supporters;
use Salsa\Models\Supporter;

// Define the endpoint
$endpoint = new Supporters($api);

// Create supporter using model
$supporter = new Supporter;
$supporter->supporterId = '-an-id-';

// Delete supporter
$response = $endpoint->delete($supporter);

// Delete multiple supporters
$response = $endpoint->deleteBatch([$supporter, $supporter2]);
```

Coding guidelines
-----------------

[](#coding-guidelines)

PSR-4.

LICENSE
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2017 [10Quality](http://www.10quality.com).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

3

Last Release

3271d ago

### Community

Maintainers

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

---

Top Contributors

[![amostajo](https://avatars.githubusercontent.com/u/1645908?v=4)](https://github.com/amostajo "amostajo (11 commits)")

---

Tags

phpapisalsa

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/10quality-salsa-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/10quality-salsa-api-php/health.svg)](https://phpackages.com/packages/10quality-salsa-api-php)
```

###  Alternatives

[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

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