All Projects → Bynder → bynder-php-sdk

Bynder / bynder-php-sdk

Licence: MIT license
SDK in PHP for integration with Bynder

Programming Languages

PHP
23972 projects - #3 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to bynder-php-sdk

fem mesh matlab
MATLAB Toolbox for Handling 2D and 3D FEM Meshes
Stars: ✭ 23 (+64.29%)
Mutual labels:  integration
neo4j-jdbc
JDBC driver for Neo4j
Stars: ✭ 110 (+685.71%)
Mutual labels:  integration
ghidra-r2web
Ghidra plugin to start an r2 webserver to let r2 interact with it
Stars: ✭ 38 (+171.43%)
Mutual labels:  integration
extensions
Code Generators and Extensions for vanilla-rtb stack
Stars: ✭ 16 (+14.29%)
Mutual labels:  integration
pivot-angular
Integration example of WebDataRocks web reporting tool with Angular 2+ framework
Stars: ✭ 30 (+114.29%)
Mutual labels:  integration
Dynatrace-OneAgent-Ansible
This Ansible role installs Dynatrace OneAgent.
Stars: ✭ 34 (+142.86%)
Mutual labels:  integration
home assistant omnik solar
Home Assistant Omnik Solar sensor component
Stars: ✭ 15 (+7.14%)
Mutual labels:  integration
mail2most
watch emails and send them to mattermost
Stars: ✭ 54 (+285.71%)
Mutual labels:  integration
logzio aws serverless
AWS Lambda function that ships Cloudwatch Logs to logz.io
Stars: ✭ 31 (+121.43%)
Mutual labels:  integration
integreat-cms
Simplified content management back end for the Integreat App - a multilingual information platform for newcomers
Stars: ✭ 46 (+228.57%)
Mutual labels:  integration
emaile2e-javascript-client
Test email integration with your app using MailSlurp
Stars: ✭ 14 (+0%)
Mutual labels:  integration
ha-eskom-loadshedding
Fetches loadshedding data from Eskom
Stars: ✭ 48 (+242.86%)
Mutual labels:  integration
reedelk-runtime
Reedelk Runtime Platform Community Edition
Stars: ✭ 25 (+78.57%)
Mutual labels:  integration
taskcluster-github
Integrate Taskcluster with Github.
Stars: ✭ 13 (-7.14%)
Mutual labels:  integration
FractionalCalculus.jl
FractionalCalculus.jl: A Julia package for high performance, fast convergence and high precision numerical fractional calculus computing.
Stars: ✭ 22 (+57.14%)
Mutual labels:  integration
ha-birthdays
Birthday integration for HomeAssistant
Stars: ✭ 14 (+0%)
Mutual labels:  integration
ltest
A Testing Framework for LFE (successor to lfeunit)
Stars: ✭ 31 (+121.43%)
Mutual labels:  integration
MDSL-Specification
A domain-specific language to specify (micro-)service contracts, data representations and endpoints.
Stars: ✭ 35 (+150%)
Mutual labels:  integration
one-sdk-js
1️⃣ One Node.js SDK for all the APIs you want to integrate with
Stars: ✭ 41 (+192.86%)
Mutual labels:  integration
DiffEqUncertainty.jl
Fast uncertainty quantification for scientific machine learning (SciML) and differential equations
Stars: ✭ 61 (+335.71%)
Mutual labels:  integration

Bynder PHP SDK

Build Coverage Status Packagist Version Packagist Downloads

The main goal of this SDK is to speed up the integration of Bynder customers who use PHP. Making it easier to connect to the Bynder API (https://bynder.docs.apiary.io) and executing requests on it.

Requirements and dependencies

The PHP SDK requires the following in order to fully work:

  • PHP >= 5.6, older versions of PHP not recommended
  • curl, although you can use your own non-cURL client if you prefer

Composer should handle all the dependencies automatically.

Composer package

The Bynder PHP SDK is published as a composer package in packagist and can be found here:

https://packagist.org/packages/bynder/bynder-php-sdk

Installation

This SDK depends on a few libraries in order to work, installing it with Composer should take care of everything automatically.

To install the SDK with Composer. Run the following command at the root of the project:

composer require bynder/bynder-php-sdk

To use the SDK, we use Composer's autoload in order to include all the files automatically:

require_once('vendor/autoload.php');

How to use it

This is a simple example on how to retrieve data from the Bynder asset bank. For a more detailed example of implementation refer to the sample code.

Before executing any request to the Bynder API we need to instantiate the BynderApi class, the following example shows how to use the BynderApiFactory to construct a BynderApi instance:

    $bynder = new BynderClient(new Configuration(
        $bynderDomain,
        $redirectUri,
        $clientId,
        $clientSecret
    ));

The SDK allows the usage of the Guzzle request options. This can be done by passing the last argument when initiating the Configuration object:

    $requestOptions = ['proxy' => 'http://MY-PROXY.URL:PORT_NUM'];
    $bynderApi = BynderClient(new Configuration(
       ...,
       $requestOptions
    ));

After getting the BynderClient service configured successfully we need to get an instance of the AssetBankManager in order to do any of the API calls relative to the Bynder Asset Bank module:

 $assetBankManager = $bynder->getAssetBankManager();

And with this, we can start our request to the API, listed in the Methods Available section following. Short example of getting all the Media Items:

 $mediaList = $assetBankManager->getMediaList();

This call will return a list with all the Media Items available in the Bynder environment. Note that some of the calls accept a query array in order to filter the results via the API call params (see Bynder API Docs) for more details. For instance, if we only wanted to retrieve 2 images here is what the call would look like:

    $mediaList = $assetBankManager->getMediaList(
        [
          'limit' => 2,
          'type' => 'image'
        ]
   );

All the calls are Asynchronous, which means they will return a Promise object, making it a bit more flexible in order to adjust to any kind of application. Again, for a more thorough example there is a sample application use case in this repo.

Methods Available

These are the methods currently available on the Bynder PHP SDK, refer to the Bynder API Docs) for more specific details on the calls.

BynderClient:

Handles the process of generating and setting the access token required for the requests to the API. Also has calls related to users.

    getAssetBankManager();
    getAuthorizationUrl();
    getAccessToken();
    getUsers();
    getUser($userId, $query);
    getCurrentUser();
    getSecurityProfile($profileId);

AssetBankManager:

All the Asset Bank related calls, provides information and access to Media management.

    getBrands();
    getMediaList($query);
    getMediaInfo($mediaId, $versions);
    getMetaproperties();
    getMetaproperty($propertyId);
    getMetapropertyDependencies($propertyId);
    getMetapropertyOptions($query);
    getMetapropetryGlobalOptionDependencies();
    getMetapropertyOptionDependencies($propertyId);
    getMetapropertySpecificOptionDependencies($propertyId, $optionId, $query);
    getTags();
    getCategories();
    getSmartfilters();
    uploadFileAsync($data);
    deleteMedia($mediaId);
    modifyMedia($mediaId, array $data);
    getDerivatives();
    getMediaDownloadLocation($mediaId, $type = 'original');
    getMediaDownloadLocationByVersion($mediaId, $version);
    getMediaDownloadLocationForAssetItem($mediaId, $itemId, $hash = false);
    createUsage($query);
    getUsage($query);
    deleteUsage($query);
    getCollections($query);
    getCollectionAssets($collectionId);

Tests

Using Docker

Build the Docker image and tag it:

docker build -t bynder-php-sdk-tests

Run the tests:

docker run bynder-php-sdk-tests

Running it locally

Install dependencies as mentioned above (which will resolve PHPUnit), then you can run the test suite:

./vendor/bin/phpunit tests

Or to run an individual test file:

./vendor/bin/phpunit tests/UtilTest.php
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].