Skip to content

StevenBullen/Bricklink-API-Helper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PHP-Bricklink-API

A PHP class method to access the Bricklink API using cURL library.

##Usage

$BricklinkApi = new /PHPBricklinkApi/BricklinkAPI([
  'tokenValue' => {TOKEN},
  'tokenSecrect' => {TOKEN_SECRET},
  'consumerKey' => {CONSUMER_KEY},
  'consumerSecret' => {CONSUMER_SECRET}
]);

$response = $BricklinkApi->request({HTTP_METHOD}, {API_PATH}, {PARAMS})
              ->execute();

Prerequisites

  • PHP 5.5+
  • cURL library extension

Create A Bricklink Instance

new /PHPBricklinkApi/BricklinkApi($params);

Returns

Returns a new instance of the BricklinkApi class.

Constructor Parameters $params

Passed as an associative array of keys and values. Accepted key values are:

Create a Request

$BricklinkApi->request($httpMethod, $apiPath, $params);

Returns

Returns your BricklinkApi instance to enable chaining.

Parameters

  • $httpMethod: Use the common REST methods. i.e. - GET, POST, PUT, DELETE
  • $apiPath: The relative path of the api. Should include a leading /.
  • $params: A string with name value pairs. i.e. - box=true&instructions=true

Execute request

$BricklinkApi->request($httpMethod, $apiPath, $params)->execute();

Returns

Returns and instance of BricklinkApiResponse

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%