Getting terms for only one taxonomy from services module I have the services module installed, and I have both taxonomy_term and taxonomy_vocabulary checked. However I'm having problems getting just the terms for one vocabulary. when I do curl -g "http://domain.com/endpoint/taxonomy_term?args[0]=machine_name_of_vocabulary" or curl -g "http://domain.com/endpoint/taxonomy_term?args[0]=2"

I get an xml result like this:

&lt;result&gt;
  &lt;item&gt;
    &lt;tid&gt;2&lt;/tid&gt;
    &lt;vid&gt;2&lt;/vid&gt;
    &lt;name&gt;Blue&lt;/name&gt;
    &lt;description/&gt;
    &lt;format&gt;filtered_html&lt;/format&gt;
    &lt;weight&gt;0&lt;/weight&gt;
  &lt;/item&gt;
  &lt;item&gt;
    &lt;tid&gt;1&lt;/tid&gt;
    &lt;vid&gt;5&lt;/vid&gt;
    &lt;name&gt;Apple&lt;/name&gt;
    &lt;description/&gt;
    &lt;format&gt;filtered_html&lt;/format&gt;
    &lt;weight&gt;0&lt;/weight&gt;
  &lt;/item&gt;
&lt;/result&gt;


which is the terms of all the vocabularies. In other words, I have the argument wrong, or the request wrong, or something else wrong.

How do I configure services and make a request to it to get only one vocabulary?
I was working on exactly the same thing the other day, the format is like this:

http://domain.com/endpoint/taxonomy_term?parameters[vid]=2


To explain that a bit further...

If you look at the code in _taxonomy_resource_definition() the index resource defines a few arguments:


page (int)
fields (string)
parameters (array)
pagesize (int)


The way to pass any of those is:

http://domain.com/endpoint/taxonomy_term?arg_name=value


Since parameters is an array you need to format it as if it was an associative array in the URL, so you use (e.g.) parameters[vid]=2.

It will also work for other parameters, e.g. parameters[name]=TermName.