Sometimes bandwidth is a major consideration, such as when building a mobile client.
To cater for this scenario the API allows you to control the amount of item data sent over the wire via the fields query parameter.
The http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children?fields=id,name request shows how you can limit the item response to only contain the id and name properties as shown in the response below:
{ "list": { "pagination": { "count": 3, "hasMoreItems": false, "totalItems": 3, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { "name": "A Folder", "id": "a5634765-ab0f-438a-8efd-bfa4139da8aa" } }, { "entry": { "name": "lorem-ipsum.txt", "id": "5516aca4-df8b-43e8-8ff3-707316c60c6e" } }, { "entry": { "name": "image.jpg", "id": "fc132aa5-6281-40bf-adee-5731e6ecb653" } } ] } }
The fields parameter works in conjunction with the include parameter so you don’t have to repeat yourself. For example, say you want to include the id, name and the optional aspectName properties in the response. It’s then possible to use the fields=id,name&include=aspectNames query parameter string. No need to specify the aspectName value again in the fields parameter.
The fields parameter is supported universally across all endpoints.