To exclude specific properties from a response body, use the exclude request parameter. The exclude parameter is available in API version 27.0 and later.
The value for the exclude query is a list of properties separated by bars (|). You must URL encode the bars as %7C. You must include a forward slash before each property name.
The following request excludes both the aboutMe and address properties from a response body:
1/chatter/users/me?exclude=/aboutMe%7C/address
The following rules describe how to use the exclude query parameter.
Forward Slashes
Include a forward slash (/) before property names or the request returns an error.
Original output:
1{2 "bar": "bar value",3 "baz": "baz value"4}
Exclude value: exclude=bar
Filtered output: 400 error with error code INVALID_FILTER_VALUE.
Filter properties by name.
Original output:
1{2 "bar": "bar value",3 "baz": "baz value"4}
Exclude value: exclude=/bar
Filtered output:
1{2 "baz": "baz value"3}
Top-Level Properties
Top-level properties cannot be filtered. Note that this query string doesn’t return an error.