Passing arrays via HTTP GET?

6,278 views
Skip to first unread message

Tim Su

unread,
Aug 4, 2010, 6:04:58 AM8/4/10
to producteev-api-discuss
The tasks/set_label method has the following parameters:

- integer id_task
- mixed id_label: can be an array of integer or just an integer

How am I supposed to pass an array of integers via GET? Can you give
an example URL for setting three labels at a time? Thanks!

Tim

aric lasry

unread,
Aug 4, 2010, 7:23:13 AM8/4/10
to Tim Su, producteev-api-discuss
Hi,
It's pretty easy :
/file.json?id_label[]=1&id_label[]=2&id_label[]=3..

Is it clear for you?

Sent from my iPhone

Tim Su

unread,
Aug 4, 2010, 9:50:13 PM8/4/10
to producteev-api-discuss
yup, thanks!

Mano

unread,
Aug 22, 2010, 9:48:00 AM8/22/10
to producteev-api-discuss
One question about this array stuff:

How does the generation of the API signature work then? Normally you
need to sort your parameters alphabetically and list the key and value
pairs after each other without an '=' sign. How does it work for
arrays?

On Aug 5, 3:50 am, Tim Su <t...@todoroo.com> wrote:
> yup, thanks!
>
> On Aug 4, 4:23 am, aric lasry <lasry.a...@gmail.com> wrote:
>
>
>
> > Hi,
> > It's pretty easy :
> > /file.json?id_label[]=1&id_label[]=2&id_label[]=3..
>
> > Is it clear for you?
>
> > Sent from my iPhone
>
> > On Aug 4, 2010, at 6:04 AM, Tim Su <t...@todoroo.com> wrote:
>
> > > The tasks/set_label method has the following parameters:
>
> > > - integer id_task
> > > - mixed id_label: can be anarrayof integer or just an integer
>
> > > How am I supposed to pass anarrayof integers via GET? Can you give

Thomas

unread,
Aug 25, 2010, 1:10:33 PM8/25/10
to producteev-api-discuss
Good question. :)

Only string parameters should be used to generate the signature.
if you have a close look at the two examples given in the doc (http://
code.google.com/p/producteev-api/#Signature), you will notice that non-
string parameters are ignored.

Thomas

Jabanaki Software

unread,
Jun 16, 2011, 12:12:29 AM6/16/11
to producteev-...@googlegroups.com
How can all of the labels be removed from a task, the API doc says

id_label:  ... If null or not specified, remove every label on the task 

I've tried various combinations of &id_label= blank or &id_label[]= blank or just leaving id_label out of the request, but I always get an error response

"You don't have access to the label"

Steve.

Thomas Bonnin

unread,
Jun 16, 2011, 11:41:05 AM6/16/11
to producteev-...@googlegroups.com
Thank for pointing this out. Problem is now fixed.
Not specifying a parameter id_label will remove every label on a task. (https://api.producteev.com/tasks/change_labels.json?id_task=XXX&token=...&api_key=...&api_sig=...)

Regards,
Thomas

Jabanaki Software

unread,
Jun 16, 2011, 8:49:52 PM6/16/11
to producteev-...@googlegroups.com
Working now, thanks!

Steve.
Reply all
Reply to author
Forward
0 new messages