API Call Requests

97 views
Skip to first unread message

Ben Dodson

unread,
Dec 21, 2012, 6:31:15 AM12/21/12
to wallabee-...@googlegroups.com
Is there a specific API call you'd like to see added to our public API? Tell us about it here and we'll see what we can do.

Ben

Mobijack

unread,
Dec 21, 2012, 12:26:10 PM12/21/12
to wallabee-...@googlegroups.com
Hi Ben,

A useful API call would be getting the item (if any) the user has committed to the set given the userID and itemType.

We can currently do this but it takes a few calls.

We envisage using this to show a user what item number they currently have in views like Market Search in HoneyBlend, and possibly in the item detail to aid with manually adding items to your watch list.

Thanks,

Jonathan
@mobijack

Ben Dodson

unread,
Dec 22, 2012, 6:58:34 AM12/22/12
to wallabee-...@googlegroups.com
Hey Jonathan,

How about a single API call which returns an array with every item_id and then an array showing the id and number of that item? That way, you could load it once and cache it when the user opens your app and you can check against it locally reducing the need for any further calls? I'd expect it to look something like this:

array(12 => array('id' => 1, 'number' => 1), 105 => array('id' => 182948', 'number' => 504))

That's just a basic example showing that I have Bearded Lady #1 (id: 1) and Baseball Bat #504 (id: 182948) but we'd list every item type with that information.

Ben

Stoozi

unread,
Dec 22, 2012, 7:10:42 AM12/22/12
to wallabee-...@googlegroups.com
Ben that API would AWESOME!!!!

Ben Dodson

unread,
Dec 22, 2012, 7:42:10 AM12/22/12
to wallabee-...@googlegroups.com

Stuart Birse

unread,
Dec 22, 2012, 8:01:53 AM12/22/12
to wallabee-...@googlegroups.com
That was quick!

I'm not sure if this will apply to everyone hoping to consume this API but the mapping algorithm we use for HoneyBlend would barf on the returned JSON as it's not a true Key-Value Pair mapping (the key is dynamic).

Instead of:
"saveditems":{
    "51":{
      "id":"3620",
      "number":"141"
    },
    "27":{
      "id":"3627",
      "number":"160"
    },
    "60":{
      "id":"5792",
      "number":"119"
    }
    ...

Could it be something like?:
"saveditems":{
    {
        "item_type_id":"51",
        "item":{
              "item_id":"3620",
              "number":"141"
        }
    },
    ...
Or
"saveditems":{
    "item":{
            "item_type_id":"51",
          "item_id":"3620",
          "number":"141"
    },
    ...


On Sat, Dec 22, 2012 at 12:42 PM, Ben Dodson <b...@bendodson.com> wrote:
Done :)

http://wallab.ee/developers/explorer/?call=/users/1/saveditems

Stuart Birse

unread,
Dec 22, 2012, 8:12:40 AM12/22/12
to wallabee-...@googlegroups.com
We could actually support the current JSON implementation with a workaround, if you want to keep the amount of data to a minimum, as both of my suggestions would increase the data traffic quite a bit!
Compliance or data traffic, either way we are excited about this API!!

Ben Dodson

unread,
Dec 22, 2012, 8:26:48 AM12/22/12
to wallabee-...@googlegroups.com
I should have listed it as a "dictionary" or "associative array" to avoid confusion (i.e. the keys can be treated as strings - they are not 0-based indexing).

We use dynamic keys for a number of things as we find them far more flexible both in implementation and in reading. For example, if I want to find out whether I have a baseball bat, I can just check for the existence of key "105" whereas if they were listed as you suggest I'd have to loop through each result until I find it. With that structure, you should be able to parse it locally and put it into any format you want but for now we'll leave the structure as is (as it's easier for us outputting and we're using it in a few projects of our own).

Reply all
Reply to author
Forward
0 new messages