Skip to content

A very simple wrapper to Erply API. Contains a sendRequest() method that takes a call name and input parameters, and returns API output as string.

Notifications You must be signed in to change notification settings

erply/api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

API Client

A basic PHP implementation of an Erply API adapter.

Dependencies

  • CURL
  • JSON

Usage

require __DIR__ . '/library/ApiClient.php';

$client = new \Erply\ApiClient\ApiClient();

$client
    ->setUrl('https://123.erply.com/api')
    ->setClientCode('123')
    ->setUsername('myuser')
    ->setPassword('mypassword')
    ->setConnectionTimeout(60)
    ->setExecutionTimeout(60);

print_r($client->sendRequest('getCustomerGroups'));

/**
 * Prints:
 * Array
 * (
 *   [status] => Array
 *   (
 *     [request] => getReasonCodes
 *     [requestUnixTime] => 1709111082
 *     [responseStatus] => ok
 *     [errorCode] => 0
 *     [generationTime] => 0.08368992805481
 *     [recordsTotal] => 5
 *     [recordsInResponse] => 5
 *   )
 *   [records] => Array
 *   (
 *     [0] => Array
 *     (
 *       [reasonID] => 1
 *       [name] => samples
 *       [added] => 0
 *       [lastModified] =>
 *       [purpose] =>
 *       [code] =>
 *       [manualDiscountDisablesPromotionTiers] => Array
 *       (
 *       )
 *     )
 *     ...
 */

About

A very simple wrapper to Erply API. Contains a sendRequest() method that takes a call name and input parameters, and returns API output as string.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages