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
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
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