PHPackages                             yudu/publisher - 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. yudu/publisher

ActiveProject[API Development](/categories/api)

yudu/publisher
==============

YUDU Publisher REST API Library - PHP

1.3.0(1mo ago)116.5k2MITPHPPHP &gt;=7.2 || &gt;=8.0CI failing

Since Dec 18Pushed 2w ago3 watchersCompare

[ Source](https://github.com/YUDUcreative/Publisher-REST-API-Library)[ Packagist](https://packagist.org/packages/yudu/publisher)[ RSS](/packages/yudu-publisher/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (6)Dependencies (4)Versions (20)Used By (0)

YUDU Publisher REST API Wrapper Library 1.0.0
---------------------------------------------

[](#yudu-publisher-rest-api-wrapper-library-100)

[![Build Status](https://camo.githubusercontent.com/aa88d6d71743fc948260d437663035a7df962ece9b7524d114aefb1847ecf388/68747470733a2f2f7472617669732d63692e6f72672f5955445563726561746976652f5075626c69736865722d524553542d4150492d4c6962726172792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/YUDUcreative/Publisher-REST-API-Library)[![Latest Stable Version](https://camo.githubusercontent.com/c4bd2b23929ffd93618ca7aeb6b8d6a86236c17f15d52a3e9d6339c416c83966/68747470733a2f2f706f7365722e707567782e6f72672f797564752f7075626c69736865722f762f737461626c65)](https://packagist.org/packages/yudu/publisher)[![Total Downloads](https://camo.githubusercontent.com/d190c8f7d5f7f2e6c7d5863658f2f5ffc0434993571f37c750b725fe8403ed6b/68747470733a2f2f706f7365722e707567782e6f72672f797564752f7075626c69736865722f646f776e6c6f616473)](https://packagist.org/packages/yudu/publisher)[![License](https://camo.githubusercontent.com/04deded00686dd4fce61c926fd642a20d146512bf98b3b76e28b01159831c55f/68747470733a2f2f706f7365722e707567782e6f72672f797564752f7075626c69736865722f6c6963656e7365)](https://packagist.org/packages/yudu/publisher)

This repository is a convenient wrapper library in PHP used to interact with the YUDU Publisher REST API. The library enables simple access to the YUDU Publisher REST API via convenient and simple to use helper methods.

The building of request headers and signatures is abstracted away to make working with the API straightforward.

To gain a deeper understanding of the YUDU publisher REST API please see [here](https://github.com/yudugit/rest-api-documentation) for more details.

This library is intended as an example to assist developers in their interaction with the YUDU Rest API. The creators are not liable for how the library is used and as such it is the responsibility of any users of the library to ensure the testing and resilience of their own production systems.

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

[](#installation)

This library can simply be installed with composer via packagist by using:

`composer require yudu/publisher`

If unfamiliar with composer more information can be found [here](https://getcomposer.org/)

How to get started?
-------------------

[](#how-to-get-started)

To use this library you will need an active YUDU Publisher Key and Secret. The Key and Secret are required to create a Publisher client. Once instantiated the Publisher client can be used for multiple requests. The results can be transformed as required. Below demonstrates how the publisher client can be created and used.

```

```

Available methods and examples
------------------------------

[](#available-methods-and-examples)

#### Get Links

[](#get-links)

```
$publisher->getLinks();

```

#### Get all readers

[](#get-all-readers)

```
$publisher->getReaders();

```

#### Get reader

[](#get-reader)

```
$publisher->getReader(123456);

```

#### Create reader

[](#create-reader)

```
$publisher->createReader([
    "username"      => "example",
    "emailAddress"  => "example@example.com",
    "firstName"     => "Micky",
    "lastName"      => "Jackson",
    "password"      => "NvrrL@nd!",
    "nodeId"        => "347358",
]);

```

#### Update reader

[](#update-reader)

```
$publisher->updateReader(12464367,[
    "username"       => "updated",
    "emailAddress"   => "updated@example.com",
    "firstName"      => "Joe",
    "lastName"       => "Bloggs",
    "password"       => "GIU^&Gkdk24",
    "nodeId"         => "347358",
]);

```

#### Delete reader

[](#delete-reader)

```
$publisher->deleteReader(123456);

```

#### Get Editions

[](#get-editions)

```
$publisher->getEditions();

```

#### Get Edition

[](#get-edition)

```
$publisher->getEdition(12345);

```

#### Create Edition

[](#create-edition)

```
$publisher->createEdition([
    "name" => "My Edition",
    "onDeviceName" => "My Edition",
    "shortName" => "MY1",
    "targetState" => [
        "web" => "LIVE",
    ],
    "documentUrl" => "https://s3-eu-west-1.amazonaws.com/my.account/test/example.pdf",
    "publicationNodeId" => "4325325",
    "pageBillingType" => "PLATFORM"
]);

```

#### Update Edition

[](#update-edition)

```
$publisher->updateEdition(6894180, [
    "name" => "My Edition",
    "onDeviceName" => "My Edition",
    "shortName" => "My Edition",
    "drmEnabled" => "true",
    "iosSaleOption" => "FREE",
    "androidSaleOption" => "FREE",
    "enableSharingByEmail" => "false",
    "enablePrinting" => "true",
    "targetState" => [
        "web" => "LIVE",
    ],
    "pageBillingType" => "PLATFORM"
]);

```

#### Delete Edition

[](#delete-edition)

```
$publisher->deleteEdition(371457);

```

#### Get Permissions

[](#get-permissions)

```
$publisher->getPermissions();

```

#### Get Permission

[](#get-permission)

```
$publisher->getPermission(16346);

```

#### Create Permission

[](#create-permission)

```
$publisher->createPermission([
    'reader'     => 2356346,
    'edition'    => 6795595,
    'expiryDate" => "2024-06-01T00:00:00Z'
]);

```

#### Update Permission

[](#update-permission)

```
$publisher->updatePermission(132365, [
    'expiryDate' => '2024-06-01T00:00:00Z'
]);

```

#### Delete Permission

[](#delete-permission)

```
$publisher->deletePermission(1443904)

```

#### Get Reader Logins

[](#get-reader-logins)

```
$publisher->getReaderLogins();

```

#### Get reader Login

[](#get-reader-login)

```
$publisher->getReaderLogin(12345);

```

#### Get Publications

[](#get-publications)

```
$publisher->getPublications();

```

#### Get Publication

[](#get-publication)

```
$publisher->getPublication(6821658);

```

#### Get Subscriptions

[](#get-subscriptions)

```
$publisher->getSubscriptions();

```

#### Get Subscription

[](#get-subscription)

```
$publisher->getSubscription(45678656);

```

#### Get Subscription Periods

[](#get-subscription-periods)

```
$publisher->getSubscriptionPeriods();

```

#### Get Subscription Period

[](#get-subscription-period)

```
$publisher->getSubscriptionPeriod(968518080);

```

#### Create Subscription Period

[](#create-subscription-period)

```
$publisher->createSubscriptionPeriod([
    'reader'       => 126417872,
    'subscription' => 6482745,
    'startDate'    => '2019-01-11T00:00:00Z',
    'expiryDate'   => '2020-01-11T00:00:00Z',
]);

```

#### Update Subscription Period

[](#update-subscription-period)

```
$publisher->updateSubscriptionPeriod(2351346 [
    'startDate'    => '2020-01-11T00:00:00Z',
    'expiryDate'   => '2021-01-11T00:00:00Z',
]);

```

#### Delete Subscription Period

[](#delete-subscription-period)

```
$publisher->deleteSubscriptionPeriod(2351346);

```

#### Remove Devices

[](#remove-devices)

```
$publisher->removeDevices(6134634);

```

#### Authenticate Password

[](#authenticate-password)

```
$publisher->authenticatePassword(2363465,'j@Cks50n');

```

#### Create Token (Access to any edition)

[](#create-token-access-to-any-edition)

```
$publisher->createToken('admin@example.com');

```

#### Create Publication Token (Access editions at publication)

[](#create-publication-token-access-editions-at-publication)

```
$publisher->createPublicationToken('admin@exmaple.com', 1246457);

```

#### Create Edition Token (Access single edition only)

[](#create-edition-token-access-single-edition-only)

```
$publisher->createEditionToken('admin@exmaple.com', 74244556);

```

#### Send Targeted Notification

[](#send-targeted-notification)

```
$publisher->sendTargetedNotification(7145646, 'title', 'message', ['admin@example.com'], [ 356h64gqh65h545vhj6, 4574655w5ujw65w5a5], 'HIGH', 'false');

```

#### Get Categories

[](#get-categories)

```
$publisher->getCategories();

```

#### Create Category

[](#create-category)

```
$publisher->createCategory([
    'categoryTitle'     => 'How to build a time machine',
    'code'              => 'adventure',
    'containsAll'       => 'true',
    'defaultCategory'   => 'false',
    'ordering'          => '4',
    'publicationNodeId' => '61',
]);

```

#### Delete ALL Categories (from specific node)

[](#delete-all-categories-from-specific-node)

```
$publisher->deleteCategories('124252');

```

#### Get Specific Category

[](#get-specific-category)

```
$publisher->getCategories('adventure');

```

#### Update Category

[](#update-category)

```
$publisher->updateCategory([
    'categoryTitle'     => 'Do you remember the time?',
    'code'              => 'adventure',
    'containsAll'       => 'true',
    'defaultCategory'   => 'false',
    'ordering'          => '4',
    'publicationNodeId' => '61',
]);

```

#### Delete Category

[](#delete-category)

```
$publisher->deleteCategory('adventure', '61');

```

#### Get Category Editions

[](#get-category-editions)

```
$publisher->getCategoryEditions();

```

#### Create Category Edition

[](#create-category-edition)

```
$publisher->createCategoryEdition([
    'code'              => 'adventure',
    'editionId'         => '64562',
    'publicationNodeId' => '61',
]);

```

#### Delete Category Edition

[](#delete-category-edition)

```
$publisher->deleteCategoryEdition([
    'publicationNodeId' => '61'
    'code'              => 'adventure'
]);

```

Custom Request
--------------

[](#custom-request)

In addition to using the methods above, it may be desirable to build the request manually. If this is the case the underlying request methods are exposed and chainable so that any request can be made. It doesnt matter what order the chained methods are added so long as the make() method is that last method to be called.

For example:

```
$results = $publisher->method("GET")->resource("readers")->make();

```

Handling responses
------------------

[](#handling-responses)

After making a call to Publisher a ResponseHandler object is returned. The Responsehandler is a wrapped Guzzle response which reveals convenient methods to assist in transforming the response into a chosen format.

Below demonstrates the methods that can be used after making a request:

```
// Makes request for readers ($results is a ResponseHandler Object)
$results = $publisher->getReaders();

// An array of request information
$results = $results->request();

// A GuzzleHttp Response
$results = $results->response();

// Get the request HTTP status code e.g 200
$status = $results->statusCode();

// Convert results to Simple XML Object
$xml_object = $results->xml()

// Convert results to XML string
$xml_string = $results->xmlString();

// Return the raw guzzle object
$guzzle = $results->guzzle();

// Return raw http request/response string
$raw = $results->raw();

// Echo Casts results to string
header("Content-type: text/xml");
echo $results;

```

Issues / Support
----------------

[](#issues--support)

General support issues can be directed to [support@yudu.com](support@yudu.com)

When requesting support it will be helpful if you can provide the raw requests and responses for any api call you are attempting. This can be obtained by passing `[ 'debug' => true ]` in the options array when instantiating the publisher library.

If you encounter a bug or have a technical question please open an issue on this repository.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance93

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 90.2% 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 ~168 days

Recently: every ~291 days

Total

17

Last Release

50d ago

Major Versions

0.0.3 → 1.0.02019-01-16

PHP version history (4 changes)0.0.1PHP &gt;=7.0

1.0.3PHP &gt;=7.1

1.0.4PHP &gt;=7.2

1.1.5PHP &gt;=7.2 || &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/676262b4f776075ab5056f19195f05db073f3c63b6db8ff2b8ad5bfe5a755b64?d=identicon)[andrew.bibby](/maintainers/andrew.bibby)

---

Top Contributors

[![andrew-bibby](https://avatars.githubusercontent.com/u/13904941?v=4)](https://github.com/andrew-bibby "andrew-bibby (74 commits)")[![ruxandra-codreanu-yudu](https://avatars.githubusercontent.com/u/7532666?v=4)](https://github.com/ruxandra-codreanu-yudu "ruxandra-codreanu-yudu (4 commits)")[![ash-allen](https://avatars.githubusercontent.com/u/38853070?v=4)](https://github.com/ash-allen "ash-allen (2 commits)")[![harveyyudu](https://avatars.githubusercontent.com/u/64775947?v=4)](https://github.com/harveyyudu "harveyyudu (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yudu-publisher/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.3M7](/packages/avalara-avataxclient)[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)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1772.4k4](/packages/aimeos-prisma)

PHPackages © 2026

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