Discussion Forum: Thread 291323 |
|
|
| | Author: | MontagueBrick | Posted: | Jun 14, 2021 01:06 | Subject: | Accessing Bricklink API with JavaScript & PHP | Viewed: | 86 times | Topic: | Problem | |
|
| Hi, I cannot figure out how to access the Bricklink API.
If someone could show me how to access the API in JavaScript and PHP that would
be great.
|
|
| | | | | |
| | | | Author: | 1001jouets.fr | Posted: | Jun 23, 2021 05:04 | Subject: | Re: Accessing Bricklink API with JavaScript & PHP | Viewed: | 40 times | Topic: | Problem | |
|
| In Problem, Joy.Brix writes:
| Hi, I cannot figure out how to access the Bricklink API.
If someone could show me how to access the API in JavaScript and PHP that would
be great.
|
Hi, here is a snippet in PHP :
-----------------
include (YOUR_PATH . '/PHPBricklinkAPI/autoload.php' ) ;
//access
$arraybkl = array(
'consumerKey' = {yourConsumerkey},
'consumerSecret' = {yourConsumersecret},
'tokenValue' = {yourTokenvalue},
'tokenSecret' = {yourTokensecret}
);
//criteria
$arrayparams = array('item_type'='set','status'='Y'
) ;
//class
$bricklinkApi = new PHPBricklinkApi\BricklinkAPI($arraybkl) ;
//all the inventory
$response = $bricklinkApi-request('GET', '/inventories' )-execute()
;
var_dump ($response-results) ;
//with some criteria
$response = $bricklinkApi-request('GET', '/inventories', $arrayparams)-execute();
var_dump ($response-results) ;
----------
Beware : I could not reproduce the superior sign (near execute, request, reponse,set,Y)
Regards
|
|
|
| | | | | |
| | | | Author: | leggodtshop | Posted: | Jun 23, 2021 06:03 | Subject: | Re: Accessing Bricklink API with JavaScript & PHP | Viewed: | 35 times | Topic: | Problem | |
|
| In Problem, Joy.Brix writes:
| Hi, I cannot figure out how to access the Bricklink API.
If someone could show me how to access the API in JavaScript and PHP that would
be great.
|
I'm using JavaScript to access BrickLink API. It's 789 lines of code
so I'm not pasting it here. Could you contact me directly?
|
|
|
|
|
|