Discussion Forum: Thread 291282

 Author: MontagueBrick View Messages Posted By MontagueBrick
 Posted: Jun 12, 2021 19:09
 Subject: Bricklink API
 Viewed: 159 times
 Topic: Problem
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

MontagueBrick (254)

Location:  USA, Wisconsin
Member Since Contact Type Status
Jul 13, 2015 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Seller Ships to My Country Store: MontagueBrick
Does anyone know how to connect to the Bricklink API? I have tried and tried
again all day and now I just keep getting CORS errors.
 Author: macebobo View Messages Posted By macebobo
 Posted: Jun 12, 2021 20:58
 Subject: Re: Bricklink API
 Viewed: 45 times
 Topic: Problem
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

macebobo (2437)

Location:  USA, Oregon
Member Since Contact Type Status
Apr 3, 2016 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Seller Ships to My Country Store: MacsBricks
In Problem, Joy.Brix writes:
  Does anyone know how to connect to the Bricklink API? I have tried and tried
again all day and now I just keep getting CORS errors.

What language are you using?
 Author: MontagueBrick View Messages Posted By MontagueBrick
 Posted: Jun 13, 2021 00:17
 Subject: Re: Bricklink API
 Viewed: 49 times
 Topic: Problem
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

MontagueBrick (254)

Location:  USA, Wisconsin
Member Since Contact Type Status
Jul 13, 2015 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Seller Ships to My Country Store: MontagueBrick
In Problem, macebobo writes:
  In Problem, Joy.Brix writes:
  Does anyone know how to connect to the Bricklink API? I have tried and tried
again all day and now I just keep getting CORS errors.

What language are you using?

I'm using React. I think I figured out how to do it with JavaScript/React.
I think the reason I was getting CORS errors was bc I was using HTTP and not
HTTPS. I need to know how to consume the API with PHP though and I'm not
having much luck finding out how. I'm new to OAuth too btw.
 Author: macebobo View Messages Posted By macebobo
 Posted: Jun 13, 2021 00:26
 Subject: Re: Bricklink API
 Viewed: 43 times
 Topic: Problem
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

macebobo (2437)

Location:  USA, Oregon
Member Since Contact Type Status
Apr 3, 2016 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Seller Ships to My Country Store: MacsBricks
In Problem, Joy.Brix writes:
  In Problem, macebobo writes:
  In Problem, Joy.Brix writes:
  Does anyone know how to connect to the Bricklink API? I have tried and tried
again all day and now I just keep getting CORS errors.

What language are you using?

I'm using React. I think I figured out how to do it with JavaScript/React.
I think the reason I was getting CORS errors was bc I was using HTTP and not
HTTPS. I need to know how to consume the API with PHP though and I'm not
having much luck finding out how. I'm new to OAuth too btw.

Oauth has an official php library: https://oauth.net/code/php/

There used to be an example in a couple languages how to consume the api, but
I can't seem to locate them now since the documentation moved. Basically,
it returns JSON, so a good php JSON library will help with consumption. Just
have to get the Oauth right first. Also, be sure you are using TLS 1.2, since
1.0 and 1.1 have been deprecated by bricklink.
 Author: Vosblokjes View Messages Posted By Vosblokjes
 Posted: Jun 13, 2021 01:43
 Subject: Re: Bricklink API
 Viewed: 52 times
 Topic: Problem
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

Vosblokjes (7204)

Location:  Netherlands, Drenthe
Member Since Contact Type Status
Dec 5, 2014 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Seller Ships to My Country Store: Vosblokjes
In Problem, macebobo writes:
  In Problem, Joy.Brix writes:
  In Problem, macebobo writes:
  In Problem, Joy.Brix writes:
  Does anyone know how to connect to the Bricklink API? I have tried and tried
again all day and now I just keep getting CORS errors.

What language are you using?

I'm using React. I think I figured out how to do it with JavaScript/React.
I think the reason I was getting CORS errors was bc I was using HTTP and not
HTTPS. I need to know how to consume the API with PHP though and I'm not
having much luck finding out how. I'm new to OAuth too btw.

Oauth has an official php library: https://oauth.net/code/php/

There used to be an example in a couple languages how to consume the api, but
I can't seem to locate them now since the documentation moved. Basically,
it returns JSON, so a good php JSON library will help with consumption. Just
have to get the Oauth right first. Also, be sure you are using TLS 1.2, since
1.0 and 1.1 have been deprecated by bricklink.

Take a look at https://github.com/blockpartybricks/Bricklink-API-Helper
For me it wasn't working out of the box, but stille helped very much
 Author: beaverbrick View Messages Posted By beaverbrick
 Posted: Jun 13, 2021 04:10
 Subject: Re: Bricklink API
 Viewed: 51 times
 Topic: Problem
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

beaverbrick (566)

Location:  United Kingdom, England
Member Since Contact Type Status
Jan 2, 2014 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store Closed Seller Does Not Ship to My Country Store: Brick Beaver
This site is a handy step-by-step guide to forming the OAuth...
http://lti.tools/oauth/

In Problem, Joy.Brix writes:
  Does anyone know how to connect to the Bricklink API? I have tried and tried
again all day and now I just keep getting CORS errors.