Hello guys, I've tried all combinations but I can't seem to get my custom field to display in my query.
Example:
http://wawineregions.com.au/wawineregions/contentapi/content?type=winery...
It doesn't display my field_rating data in the returned results. I have told Content API to return all the fields in the backend Drupal admin interface so it should be able to return my custom field "field_rating". I assume the query parameter to "fields[]=" should be the machine name of the field and not the label (field_rating is the machine name, the label is Winery Rating).
Do you guys have any ideas?
I am using Drupal 7, Services 3.x, Content API 7.x-1.0-alpha3.
I also got an error in the Drupal admin interface:
"
Warning: unserialize() expects parameter 1 to be string, array given in _contentapi_index() (line 455 of /srv/wawineregions.com.au/www/wawineregions/sites/all/modules/contentapi/contentapi.module).
"
Not sure if that has anything to do with me not being able to see my custom field being displayed in the REST end point results?
Many thanks in advance.
Comments
Comment #1
zingodude commentedTry enable your custom field in the Content API Settings. Usually you need to check it to enable display.
Comment #2
mindbat commentedI'm having the same issue. The fields[] parameter doesn't seem to have an effect on the returned values at all. Even choosing fields[]=title returns all the basic fields for the nodes, not just the title field.
I'm also not getting any of my custom fields back from the API calls. Just the base fields are being returned, even though I've got the Content API settings configured to return everything.
Comment #3
bsuttis commentedConfirming I get the same behaviour when I get an index of nodes but not when getting a single node (i.e. http://localhost/api/content/node does not show custom fields, while http://localhost/api/content/node/1 does)