Announcement

#1 2013-01-10 09:46:08

mcl
Member
2012-11-22
30

[Resolved]API ws.htm - Format for Array Selection - pwg.tags.getImages

I am trying 'pwg.tags.getImages' with field 'tag_name' containing more than one value and I do not seem able to find the correct format for entering it as an array.

I have tried various combinations of square brackets, %5B or %5D, quoting the tag_name or not, separating by either comma or semi-colon, but none seem to work.  If I use a single TAG value, then that works correctly.

Can someone help with the correct format for an array field entry either the 'ws.htm' way or the 'URL' way

Thanks

Last edited by mcl (2013-01-10 13:39:32)

Offline

 

#2 2013-01-10 11:15:46

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: [Resolved]API ws.htm - Format for Array Selection - pwg.tags.getImages

in ws.htm there is not brackets
just write "2|16" (no quotes) in "tag_id" field
but perhaps it doesn't work... I corrected some little bugs when a rewrote this file (for Piwigo 2.5)

for the url you must use the common way to pass an array in a GET query
ws.php?format=rest&method=pwg.tags.getImages&tag_id[]=2&tag_id[]=16

Offline

 

#3 2013-01-10 11:57:51

mcl
Member
2012-11-22
30

Re: [Resolved]API ws.htm - Format for Array Selection - pwg.tags.getImages

Brilliant - Many Thanks

Both ways work as you said with piwigo.com

mcl

Offline

 

#4 2023-07-15 15:38:25

phpb
Member
2023-07-10
3

Re: [Resolved]API ws.htm - Format for Array Selection - pwg.tags.getImages

Hi, I have the same question but 10 years after, the answer seem to be no more working in my case, I get the "<err code="1003" msg="cat_id must only contain positive integers" />" if I try &tag_id[]=2&tag_id[]=16

can someone help me to get image list of several categories through API,
Thank you

Offline

 

#5 2023-07-15 16:37:27

phpb
Member
2023-07-10
3

Re: [Resolved]API ws.htm - Format for Array Selection - pwg.tags.getImages

in fact it works perfectly well, sorry for the inconvenience, the problem were elsewhere in my called URL

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact