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

ActiveLibrary[API Development](/categories/api)

simmcomm/content-api-client
===========================

Content API client

0.13.1(2mo ago)0805[2 PRs](https://github.com/simmcomm/content-api-client-php/pulls)proprietaryPHPPHP ^7.4.0 || ^8.0.0CI passing

Since Jan 28Pushed 2mo ago4 watchersCompare

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

READMEChangelog (3)Dependencies (13)Versions (52)Used By (0)

Flowly Content API Client
=========================

[](#flowly-content-api-client)

Installation
============

[](#installation)

```
composer require simmcomm/content-api-client

```

Usage
=====

[](#usage)

```
require __DIR__ . '/vendor/autoload.php';

use Flowly\Content\ContentApiClient;

// $access and $secret are from Flowly app API keys module
$client = new ContentApiClient($access, $secret);

// it is possible to inject instance of
// Symfony\Contracts\HttpClient\HttpClientInterface as third parameter for
// custom initialization

// all request arguments and responses are mapped to their class
// mapping classes are located in namespaces Flowly\Content\Request and Flowly\Content\Response
// all methods in api client are accordingly typed (arguments and return value)

// public client api

// before sending any request, it is required to set auth alias:
$client->setAuthAlias('');

// used on scene list view
$client->getScenes();

// single scene object
$client->getScene();

// similar videos, based on scene id passed to this method
$client->getScenesSuggest();

// actors and categories lists
$client->getCategories();
$client->getActors();

// scene or actor can be star rated (1-5 scores)
$client->submitRating();

// used for portal landing page
$client->getScenesLanding();
```

Flowly content API
==================

[](#flowly-content-api)

Root endpoint: `'https://api-content.flowly.com'`.

GET `/scenes`
-------------

[](#get-scenes)

### query

[](#query)

- `categories: int[] = []`
    - category id filter, empty (default) means no filter
- `categoriesExclude: int[] = []`
    - exclude categories filter
- `actors: int[] = []`
    - actor id filter, empty (default) means no filter
- `orderBy: "added"|"duration"|"name"|"usage"|"rating" = "added"`
    - value is string enum, wrong value is ignored and default is used instead
        - `"usage"`: usage (clicks) counter
        - `"rating"`: user rating (likes/dislikes, stars; tbd)
- `orderDir: "asc"|"desc" = null`
    - force different sorting order
    - defaults:
        - added: desc
        - duration: desc
        - name: asc
        - usage: desc
        - rating: desc
- `offset: int = 0`
- `limit: int = 25`
- `links: bool = false`
    - if true, only links are provided instead of objects
- `videoResolution: 360|480|720|1080 = null`
    - video links will be returned for specified resolution
    - value meaning is video **height**
    - null means the highest possible resolution
- `imageResolution: 360|480|640|720|1080 = null`
    - image links will be returned for specified resolution
    - value meaning is image **width**
    - null means the highest possible resolution
    - cover image is not affected, it is always 1024 pixels wide
- `licensor: int = null`
    - only `afsc` in intial version (numeric identifier)
    - `null` means any
    - allowed values will be extended in future (as new licensors are added)
- `rating: string = ">=1.0
