Getting 400 for calls to Catalog APIs

Hello All,

I contacted the BrickOwl to be given access to the Catalog APIs - and my request was granted. Today I am trying to access the API by making very simple GETs and every endpoint is throwing a 400. My request looks like this:

https://api.brickowl.com/v1/catalog/id_lookup?key={my_key}&id=42092

What am I doing wrong? Not sure what the 400 means in this context. I am calling the endpoint in a Promise structure wrapped in a try/catch, so I know I'm giving it time to resolve.

Any help will be very appreciated!

Comments

  • 3 Comments sorted by Votes Date Added
  • Aren't you missing the type argument?
    As stated on the API page it isn't optional. So if you want set 42092:
    https://api.brickowl.com/v1/catalog/id_lookup?key={my_key}&id=42092&type=Set

    And you can simply test by putting the URL in a browser, I find it the most simple way to check if everything is correct.
  • That was it - adding the "type" argument fixed it. And good call on using the browser as a quick test, I AM getting data back when using the browser - but not with my API code. Thus I'm doing something wrong.

    Thank you very much for your help BasKrie, I sincerely appreciate it.
  • edited December 2020 Vote Up0Vote Down
    Your welcome, no problem. I started using the browser when my first attempts on the coding side failed. Very handy to see if the link used is working and to see what data is being returned (in full).
    Good luck with finding the error and fixing it.

    I'm not a coding guru, just did some work in PHP and that is working for my needs (no need to get catalog items). Since I'm not being blocked I guess I did not do anything funny to overload the API :smile:
Sign In or Register to comment.