PHPackages                             atech/sirportly - 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. atech/sirportly

ActiveLibrary[API Development](/categories/api)

atech/sirportly
===============

Interact with your Sirportly data using PHP.

246.0k↓46.4%9[1 PRs](https://github.com/sirportly/php-library/pulls)PHP

Since Oct 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/sirportly/php-library)[ Packagist](https://packagist.org/packages/atech/sirportly)[ RSS](/packages/atech-sirportly/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Sirportly PHP API
=================

[](#sirportly-php-api)

This library allows you to interact with your Sirportly data using PHP.

Setting up a Sirportly Client
-----------------------------

[](#setting-up-a-sirportly-client)

```
$sirportly = new Sirportly('the-token','the-secret');
```

Creating a ticket
-----------------

[](#creating-a-ticket)

You can create tickets within your Sirportly system with a few commands. It's important to note that creating a new ticket is a two step process - firstly, you need to create a `Ticket` record and then you need to post your initial update using `post_update` on your newly created ticket.

```
# Create the skeleton ticket
$properties = array(
    'brand' => 'Sirportly',
    'department' => 'Sales Enquiries',
    'status' => 'New',
    'priority' => 'Normal',
    'subject' => 'A new sales enquiry',
    'name' => 'My New Customer',
    'email' => 'customer@atechmedia.com',
    );

  $ticket = $sirportly->create_ticket($properties);

# Now add the first update to this ticket
$update = $sirportly->post_update(array('ticket' => $ticket['reference'], 'message' => 'I would like some more info about your product', 'customer' => $ticket['customer']['id'] ));
```

If an error occurs, you will receive an array of errors. There are many other properties which can be passed to the `create_ticket` method which are not documented here. Take a look at the [API documentation](http://www.sirportly.com/docs/api-specification/tickets/submitting-a-new-ticket)for more information about the options available.

Accessing Tickets
-----------------

[](#accessing-tickets)

```
$sirportly->tickets();
$sirportly->ticket(array('reference' => 'AB-123123'));
```

Changing ticket properties
--------------------------

[](#changing-ticket-properties)

If you wish to change properties of a ticket, you can use `update_ticket`. This function behaves exactly the same as the corresponding API method and further details can be found in the [documentation](https://atech.sirportly.com/knowledge/4/api-specification/tickets/changing-ticket-properties).

```
# Change a ticket status
$sirportly->update_ticket(array('ticket' => 'GI-857090', 'status' => 'waiting for staff'));

# Change a ticket priority
$sirportly->update_ticket(array('ticket' => 'GI-857090', 'priority' => 'low'));

# Change multiple attributes
$sirportly->update_ticket(array('ticket' => 'GI-857090', 'team' => '1st line support', 'user => 'dave'));
```

Once an update has been carried out, the original ticket object will be updated to include the new properties.

Posting updates to tickets
--------------------------

[](#posting-updates-to-tickets)

Posting updates to tickets is a simple affair and the `post_update` function will accept the same parameters as defined in the [documentation](http://www.sirportly.com/docs/api-specification/tickets/posting-an-update).

```
# To post a system message without a user
$sirportly->post_update(array('ticket' => 'GI-857090', 'message' => 'My Example Message' ));

# To post an update as the ticket customer
$sirportly->post_update(array('ticket' => 'GI-857090', 'message' => 'My Example Message', 'customer' => 'Daniel' ));

# To post an update as a user
$sirportly->post_update(array('ticket' => 'GI-857090', 'message' => 'My Example Message', :user => 'Daniel')

# To post a private update as a user
$sirportly->post_update(array('ticket' => 'GI-857090', 'message' => 'Private Msg', 'user' => 'Daniel', 'private' => true ));
```

Executing Macros
----------------

[](#executing-macros)

If you wish to execute one of your macros on a ticket, you can use the `run_macro` function which accepts the ID or name of the macro you wish to execute. If executed successfully, it will return true and the original ticket properties will be updated.

```
$sirportly->run_macro( array('ticket' => 'GI-857090', 'macro' => 'Mark as waiting for staff') );
```

Adding follow ups
-----------------

[](#adding-follow-ups)

Adding to follow ups to tickets can be achieved by executing the `add_follow_up`function.

```
$sirportly->add_follow_up( array('ticket' => 'GI-857090', 'actor' => 'Daniel', 'status' => 'resolved', 'run_at' => 'yyyy-mm-dd hh-mm') );
```

The `run_at` attribute should be a timestamp as outlined on our [date/time formatting page](http://www.sirportly.com/docs/api-specification/date-time-formatting) in the API documentation.

Creating a user
---------------

[](#creating-a-user)

You can create users (staff members) via the API.

```
$user_properties = array(
    'first_name' => 'John',
    'first_name' => 'Particle',
    'email_address' => 'john@testcompany.com',
    'admin_access' => true,
    );

$sirportly->create_user($user_properties);
```

There are other attributes available, which can be viewed on the [API docs](http://www.sirportly.com/docs/api-specification/users/create-new-user).

You do not need to create individual customers. These are created automatically on ticket and ticket update creation.

Accessing Static Data Objects
-----------------------------

[](#accessing-static-data-objects)

The Sirportly API provides access to all the data objects stored in your Sirportly database. At the current time, these cannot be edited through the API.

```
$sirportly->statuses();
$sirportly->priorities();
$sirportly->brands();
$sirportly->users();
```

You can access the following objects using this method: brands, departments, escalation\_paths, filters, priorities, slas, statuses, contacts, teams and users.

Executing SPQL queries
----------------------

[](#executing-spql-queries)

Sirportly includes a powerful query language called SPQL (SirPortly Query Language) which allows you to query your ticket data through the API. This is primarily used to generate reports however can also be used to return data for your own purposes.

```
$sirportly->spql(array('spql' => 'SELECT COUNT, status.name FROM tickets GROUP BY status.
```

Access a list of knowledge bases.
---------------------------------

[](#access-a-list-of-knowledge-bases)

You can get a list of all the knowledgebases in your account by calling:

```
$sirportly->kb_list()
```

Access a single knowledge base
------------------------------

[](#access-a-single-knowledge-base)

You can access a single knowledge bases' full tree of pages by using:

```
$sirportly->kb($kb_id = 1234);
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![adamcooke](https://avatars.githubusercontent.com/u/4765?v=4)](https://github.com/adamcooke "adamcooke (3 commits)")[![danmatthews](https://avatars.githubusercontent.com/u/149426?v=4)](https://github.com/danmatthews "danmatthews (2 commits)")[![adamwest-krystal](https://avatars.githubusercontent.com/u/11274588?v=4)](https://github.com/adamwest-krystal "adamwest-krystal (1 commits)")[![brodkin](https://avatars.githubusercontent.com/u/236564?v=4)](https://github.com/brodkin "brodkin (1 commits)")[![leewillis77](https://avatars.githubusercontent.com/u/1097338?v=4)](https://github.com/leewillis77 "leewillis77 (1 commits)")[![Mitcheh](https://avatars.githubusercontent.com/u/2826606?v=4)](https://github.com/Mitcheh "Mitcheh (1 commits)")

### Embed Badge

![Health badge](/badges/atech-sirportly/health.svg)

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

###  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)[facebook/php-business-sdk

PHP SDK for Facebook Business

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

PHP wrapper for the Meilisearch API

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

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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