Download the PHP package dsync/php-sdk without Composer

On this page you can find all versions of the php package dsync/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-sdk

DSYNC PHP SDK

PHP SDK for realtime synchronization with DSYNC

Overview

The DSYNC PHP SDK is a quick start bundle for developers who are interested in connecting 3rd party systems with the DSYNC platform. By crafting an external connector based on the SDK, your system will be automatically able to exchange data in near real-time with vast array of different systems, APIs, and databases already available on the DSYNC platform.

Near real-time data exchange between DSYNC and 3rd party system uses the secured http protocol. The external connector you need to build is essentially a RESTful API able to receive and send http requests from and to the DSYNC platform only. Some systems may have an existing API which you can simply extend and bend to the DSYNC specification or you may need to build one from scratch.

You don’t have to be concerned with all the different APIs disparate systems may have – that’s DSYNC’s responsibility. All you need to build is the communication channel between your system and the DSYNC platform.

Authentication

DSYNC platform uses API keys for communication with 3rd party systems. You can create a new API key from within your DSYNC account by going into “My Account” section. Treat this key as a password. Anyone with the key can send/receive data on your behalf. As there is no expiration set for API keys, it is highly recommended to rotate the API key every so often to prevent unauthorised access.

The API key must be sent with every request you make to the DSYNC platform. Your connector must be able to store this key and send it in ‘Auth-Token’ header along with the request data. If you fail to send valid API key the DSYNC platform responds with 401 Unauthorized. The DSYNC PHP SDK will add the headers for you when you set the authorization token on the request.

Glossary

Data Layout

Schema in JSON format which defines one or more endpoints and all their respective fields. Generated by you in 3rd party system and sent to DSYNC.

For DSYNC to build and display a new system correctly on the canvas, the data layout which your connector generates must define at least one entity and the entity must have at least one field (eg. Product entity with SKU field).

Endpoint/Entity

A single resource/object inside the 3rd party system. (eg. Product).

Field

An attribute of an entity (eg. SKU)

API Key

(aka Auth Token) Password used to authenticate http requests between 3rd party system and the DSYNC platform

Entity Token

(aka Endpoint Token) Unique identifier of an endpoint generated by 3rd party system and sent to DSYNC in data layout. System scope – must be unique.

Treekey

Uniquely identifies position of a single field inside an entity schema. Uses object dot notation. Entity scope – must be unique.

Getting Started

Full account setup instructions can be found at the Developer Portal (https://dsyncsdk.docs.apiary.io/reference/diy-connector)

API Documentation

Full API documentation can be found at the Developer Portal (https://dsyncsdk.docs.apiary.io/reference/source)

Installation

Install this package with composer:

Requests

Create a request using the RealtimeRequest object. You can add authentication and endpoint token (that was set in the datalayout) along with the data before making the request.

Example realtime "Create" request

Example realtime "Update" request

Example realtime "Delete" request

The 'Delete' request requires the primary key (setEntityId) that was defined in the datalayout as as this method does not send a body.

Responses

All realtime methods will throw a RealtimeRequestException on error or return an array of data if successful.

Datalayout Utils

The PHP SDK comes with some utils to generate the layout and tokens for each endpoint. The DSYNC application must be able to consume your generated datalayout. For further details please see the Developers Portal (https://dsyncsdk.docs.apiary.io/#reference/destination/data-layout/get-data-layout)

Example of generating a datalayout array

Build the fields first and add them to the endpoint objects. Add the endpoint objects to the datalayout object before running the 'generate' method.

If using Symfony or something similar add the generated array to the response:

Example of generating an entity token

Running developer coding standards and tests

Install packages with composer:

Install Ant (http://ant.apache.org/):

Run Ant:


All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dsync/php-sdk contains the following files

Loading the files please wait ....