API Changes

'bl_lot_id' will be removed from the API in the next day or two. It has been replaced by an array called 'external_id'. this will support multiple external IDs and better allow for Amazon synchronisation later on.

'boid' has been added to many of the API methods. This is a unique Brick Owl item ID. Coloured items consist of the main BOID with a - and then the color id.

Comments

  • 22 Comments sorted by Votes Date Added
  • Will our current values in 'bl_lot_id' be mapped to the new 'external_id' ?
  • Any current external IDs will be in the new external ID. It has operated this way internally for a while, it is just a renaming.
  • It appears that the array is named "external_lot_ids" not "external_id" as noted above.

    I think I need help with the array inside the item json array. looking at an example, it looks like arrays are formatted two different ways in the same string...

    ,"external_lot_ids":["14620632"],

    and

    ,"ids":{"4034":{"id":"4034","type":"design_id"},"403440":{"id":"403440","type":"item_no"},"90734-97":{"id":"90734-97","type":"boid"}}}

    Shouldn't the external lot array be formatted with key -> value within braces like the ids array?
  • edited September 2013 Vote Up0Vote Down
    I tried...
    $XML .= "<ITEM><LOTID>".$items[$j][external_lot_ids]."</LOTID>";
    but got output of...
    <ITEM><LOTID>Array</LOTID>
    so I added...
    $XML .= "<ITEM><LOTID>".$items[$j][external_lot_ids][0]."</LOTID>";
    and it worked. But I'm concerned about "hardcoding" the array key to the first position, especially if more external IDs get added to the array in the future. Is there a better way?
  • Presumably additional IDs will have to be added by the seller, so nothing new should appear unexpectedly. If you only require one other external ID, index zero should always be good.
    Presumably again, any additional external ID's that each seller may require will always have a consistent index position, be it data or empty string. Once we know the index position, hardcoding it should be safe enough. I guess... :)
  • Okay, I have keyed that array now. The current field is just a dumping ground for any ID, I don't know what the ideas in particular so I have named it other. Later, the Amazon ID will be named Amazon.

    I am well aware it is awful to change an API at short notice without giving access to the old version... I will try to be better in the future.
  • Gives me an excuse to revise that Python dictionaries chapter - a welcome break from thinking up new part names :D
  • Need a little help with updates into BO. I think its array related.

    api.brickowl.com/v1/inventory/update?... ...external_lot_ids=$id doesn't seem to work. Can you even pass an array as a POST variable?

    would it be ...external_lot_ids[0]=$id or ...external_lot_ids=array($id)?
  • It's external_id I think, you just pass one variable to it
  • So GET is external_lot_ids as an array and POST is external_id as a single value?
  • Regarding my earlier post when getting BO order details...
    $XML .= "<ITEM><LOTID>".$items[$j][external_lot_ids][0]."</LOTID>";
    now needs to be ...
    $XML .= "<ITEM><LOTID>".$items[$j][external_lot_ids][other]."</LOTID>";
    to work correctly. I guess the json to array function doesn't like the numerical reference.
  • I have no clue what language most of this is in 8-}
  • edited September 2013 Vote Up0Vote Down
    I will tell you the extent of my language. HTML 1.0 back around the year 1996.... hmm maybe closer to 1998?
    I was a wiz at making tables and bolding text! lol
  • Last time I programmed it was on my Vic 20. Saved that one to tape.

    Much more user friendly than the TRS-80...
  • Tape - tape? you were lucky, when I were a lad we had to use punch cards! :O
  • True, but I am still old enough to forget I told that "joke" already here until a few hours later. :)
  • edited September 2013 Vote Up0Vote Down
    Sorry guys & gals, I am to young for those. Although I know of and have held both tape and punch cards, I was not around when they were in use.
  • The tape the Vic used was just a cassette tape, not so old school as the big reel tape. I don't think I have seen one of those.

    I had a tape with over 100 games on it I think, I should find an emulator, some of those and get out of this thread....
  • FYI I have updated the Rebrickable API calls so it is now using the BOID numbers when processing everyone's store inventories.
  • Cool, I love innovation and cooperation.

    Brian
Sign In or Register to comment.