Help with the basics

6 views
Skip to first unread message

Warren

unread,
Jan 30, 2010, 12:11:39 PM1/30/10
to Hiveminder API Hackers
Hi,

I'm just getting started with the API, and I'm having trouble with the
basics.

The task at hand is to retrieve the list of tags used. I'm using curl
to play around, as in the help.

I'm able to get the list of model objects back:

curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE http://hiveminder.com/=/model.json

BTDT.Model.TaskTag seems like the best option. I get its fields:

curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE http://hiveminder.com/=/model/BTDT.Model.TaskTag.json

It looks like there might be one of these per task-tag combination.
Getting them all in the general case might be expensive, but I only
have a handful of tasks at this point.

First attempt to get a list of tags:

curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE http://hiveminder.com/=/model/BTDT.Model.TaskTag/tag.json

Per the help, this should "list model items", which sounds like it
would return the values of the "tag" fields for BTDT.Model.TaskTag. I
get a 500 Internal server error.

Second attempt:

curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE http://hiveminder.com/=/search/BTDT.Model.TaskTag/tag.json

My guess is that this would apply the search criteria (none), and then
return the values of the "tag" fields. I get an empty array back.

Perhaps criteria is necessary?

curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE
http://hiveminder.com/=/search/BTDT.Model.TaskTag/not/tag/sadfasfasfasdf/tag.json

Nope: I get an empty array back.

Third attempt:

curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE -F tag_not=asdfasdfasdf
http://hiveminder.com/=/action/BTDT.Action.SearchTaskTag.json

500 Internal server error


At this point, I'm out of ideas.


Here's the documentation I've found so far:
http://hiveminder.com/help/reference/API.html
http://hiveminder.com/=/help
http://hiveminder.com/=/help/search

Please let me know if I've missed some.

Thanks,

-Warren

Alex Vandiver

unread,
Feb 8, 2010, 9:04:16 PM2/8/10
to hivemin...@googlegroups.com
On Sat, 2010-01-30 at 09:11 -0800, Warren wrote:
> I'm just getting started with the API, and I'm having trouble with the
> basics.
>
> The task at hand is to retrieve the list of tags used. I'm using curl
> to play around, as in the help.

Sadly, our database normalization doesn't easily present "the set of
tags that I've used" -- but see below.

> First attempt to get a list of tags:
>
> curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE http://hiveminder.com/=/model/BTDT.Model.TaskTag/tag.json
>
> Per the help, this should "list model items", which sounds like it
> would return the values of the "tag" fields for BTDT.Model.TaskTag. I
> get a 500 Internal server error.

..because the server was attempting to apply ACLs limiting which results
you could see, and was doing so server-side rather than database-side --
which timed as it it tried to walk through all 800k rows and check the
ACLs on each one. I've checked in a fix for this, and it should show up
in production on Wednesday. Please don't try it before then, though, as
otherwise it'll hose the server a bit. :)

> Second attempt:
>
> curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE http://hiveminder.com/=/search/BTDT.Model.TaskTag/tag.json
>
> My guess is that this would apply the search criteria (none), and then
> return the values of the "tag" fields. I get an empty array back.
>
> Perhaps criteria is necessary?

This works for me.

> curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE
> http://hiveminder.com/=/search/BTDT.Model.TaskTag/not/tag/sadfasfasfasdf/tag.json
>
> Nope: I get an empty array back.

The search action is simplistic, and doesn't do negation.

> Third attempt:
>
> curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE -F tag_not=asdfasdfasdf
> http://hiveminder.com/=/action/BTDT.Action.SearchTaskTag.json
>
> 500 Internal server error

This was caused by the same ACL problem as above, so there's a fix for
it that should land shortly.
- Alex

Warren Blanchet

unread,
Feb 9, 2010, 9:27:36 AM2/9/10
to hivemin...@googlegroups.com
On Mon, Feb 8, 2010 at 7:04 PM, Alex Vandiver <ale...@bestpractical.com> wrote:
> On Sat, 2010-01-30 at 09:11 -0800, Warren wrote:
>> First attempt to get a list of tags:
>>
>> curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE http://hiveminder.com/=/model/BTDT.Model.TaskTag/tag.json
>>
>> Per the help, this should "list model items", which sounds like it
>> would return the values of the "tag" fields for BTDT.Model.TaskTag. I
>> get a 500 Internal server error.
>
> ..because the server was attempting to apply ACLs limiting which results
> you could see, and was doing so server-side rather than database-side --
> which timed as it it tried to walk through all 800k rows and check the
> ACLs on each one.  I've checked in a fix for this, and it should show up
> in production on Wednesday.  Please don't try it before then, though, as
> otherwise it'll hose the server a bit. :)

Well, sorry about the DOS attack, then. I look forward to trying this
on Saturday.

>> Second attempt:
>>
>> curl -b JIFTY_SID_HIVEMINDER=$HMCOOKIE http://hiveminder.com/=/search/BTDT.Model.TaskTag/tag.json
>>
>> My guess is that this would apply the search criteria (none), and then
>> return the values of the "tag" fields. I get an empty array back.
>

> This works for me.

Bizarre. I just tried it again and still get back an empty array. If
the model/ query works, though, I suppose it doesn't matter.

Thanks for your help,

-Warren

Reply all
Reply to author
Forward
0 new messages