Received "An illegal choice has been detected. Please contact the site administrator" while creating node with taxonomy field via service3 drupal7 I am having an error:


  {"form_errors":{"field_category][und":"An illegal choice has been detected. Please contact the site administrator."}}


Field category is a taxonomy field attached to a node. I'm trying to create a node via web services and unable to create taxonomy field. I have also match post array by doing print_r($obj) on node form validate:

PHP Array:

[field_category] =&gt; Array(
  [und] =&gt; Array(
    [0] =&gt; Array(
      [tid] =&gt; 6246
    )
  )
)


JSON conversion:

"field_category": {
  "und": [
    {
      "tid":6246
    }
  ]
}


However, in response having an error, the same problem with the other taxonomy field. What I am doing wrong with it.
I was having the same issue. After reading this I was able to figure out the problem by doing a dsm($_POST) on hook_node_update() and inspecting the array and figuring out what it expects.

In my case my array looked like this:

'field_term_subtype[und]' =&gt; '166',


In your case it would be:

{
    "title": "your title",
    "type": "page",
    "field_category": {
        "und": 6246
    }
}