Discussion Forum: Thread 291323

 Author: MontagueBrick View Messages Posted By MontagueBrick
 Posted: Jun 14, 2021 01:06
 Subject: Accessing Bricklink API with JavaScript & PHP
 Viewed: 86 times
 Topic: Problem
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

MontagueBrick (251)

Location:  USA, Wisconsin
Member Since Contact Type Status
Jul 13, 2015 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: MontagueBrick
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 View Messages Posted By 1001jouets.fr
 Posted: Jun 23, 2021 05:04
 Subject: Re: Accessing Bricklink API with JavaScript & PHP
 Viewed: 40 times
 Topic: Problem
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

1001jouets.fr (1)

Location:  France, Île-de-France
Member Since Contact Type Status
Mar 2, 2021 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: 1001jouets.fr
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 View Messages Posted By leggodtshop
 Posted: Jun 23, 2021 06:03
 Subject: Re: Accessing Bricklink API with JavaScript & PHP
 Viewed: 35 times
 Topic: Problem
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

leggodtshop (3861)

Location:  Netherlands, Overijssel
Member Since Contact Type Status
Aug 11, 2006 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Leggodt.nl
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?