Discussion Forum: Thread 358066

 Author: TheRIK View Messages Posted By TheRIK
 Posted: May 22, 2024 13:59
 Subject: PHP & BrickLink API
 Viewed: 86 times
 Topic: LANG Deutsch
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

TheRIK (63)

Location:  Germany, Nordrhein-Westfalen
Member Since Contact Type Status
Jan 22, 2022 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Klemmbausteiner
Hallo Zusammen,

ich versuche mit einem selbst geschriebenen PHP Skript auf die BrickLink API
zuzugreifen. Klappt soweit auch Recht gut, außer wenn es um das Thema der "Zusätze"
geht. Quasi das hier klappt "GET /items/part/3001old/price" während das
hier "GET /items/part/3001old/price?new_or_used=U" nicht klappt. Ich
werde einfach nicht schlau draus...

Vielleicht hat ja jemand eine Idee...
 Author: WWTech View Messages Posted By WWTech
 Posted: May 28, 2024 07:49
 Subject: Re: PHP & BrickLink API
 Viewed: 68 times
 Topic: LANG Deutsch
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

WWTech (1) 

Location:  Germany, Niedersachsen
Member Since Contact Type Status
May 22, 2024 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: More-Bricks
In LANG Deutsch, TheRIK writes:
  Hallo Zusammen,

ich versuche mit einem selbst geschriebenen PHP Skript auf die BrickLink API
zuzugreifen. Klappt soweit auch Recht gut, außer wenn es um das Thema der "Zusätze"
geht. Quasi das hier klappt "GET /items/part/3001old/price" während das
hier "GET /items/part/3001old/price?new_or_used=U" nicht klappt. Ich
werde einfach nicht schlau draus...

Vielleicht hat ja jemand eine Idee...

Poste doch mal das Script
 Author: TheRIK View Messages Posted By TheRIK
 Posted: Jun 1, 2024 23:53
 Subject: Re: PHP & BrickLink API
 Viewed: 61 times
 Topic: LANG Deutsch
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

TheRIK (63)

Location:  Germany, Nordrhein-Westfalen
Member Since Contact Type Status
Jan 22, 2022 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Klemmbausteiner
In LANG Deutsch, WWTech writes:
  In LANG Deutsch, TheRIK writes:
  Hallo Zusammen,

ich versuche mit einem selbst geschriebenen PHP Skript auf die BrickLink API
zuzugreifen. Klappt soweit auch Recht gut, außer wenn es um das Thema der "Zusätze"
geht. Quasi das hier klappt "GET /items/part/3001old/price" während das
hier "GET /items/part/3001old/price?new_or_used=U" nicht klappt. Ich
werde einfach nicht schlau draus...

Vielleicht hat ja jemand eine Idee...

Poste doch mal das Script

function fetchCurrentPrices($itemNo, $itemType, $colorId) {
$part = strtolower($itemType);
$url = "https://api.bricklink.com/api/store/v1/items/$part/$itemNo/price?guide_type=sold";
$response = makeRequest($url, 'GET';
if ($response['code'] != 200) {
logError("Error fetching current prices for item $itemNo in color
$colorId: {$response['body']}";
return null;
} else {
return json_decode($response['body'], true);
}
}