Excluding Null Data

To reduce the amount of data returned by excluding those properties with null data, use the header as shown in the following table:

Header Value

prefer

exclude-null-properties

For related examples, see:

Example with All Data

This example shows all of the data for the account with ID 1.

Using a GET request with the following syntax:

https://mysite.example.com/services/rest/connect/v1.4/accounts/1
and no prefer header, returns the following:
{
    "id": 1,
    "lookupName": "Administrator -",
    "accountHierarchy": {
        "links": [
            {
            "rel": "self",
            "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1/accountHierarchy"
            }
        ]
    },
    "attributes": {
        "accountLocked": false,
        "canModifyEmailSignature": false,
        "forcePasswordChange": false,
        "infrequentUser": false,
        "passwordNeverExpires": false,
        "permanentlyDisabled": false,
        "staffAssignmentDisabled": true,
        "viewsReportsDisabled": true,
        "virtualAccount": false
    },
    "country": null,
    "customFields": {
        "CO": {
            "ca_ac_date": null,
            "ca_ac_integer": null,
            "ca_ac_menu": null,
            "ca_ac_radio": null,
            "ca_ac_text": null,
            "ca_ac_text_email": null,
            "ca_ac_text_long": null,
            "ca_ac_text_url": null,
            "ca_ac_time": null
        },
        "CustParent": {
            "CPObject3ID": null
        },
        "SelfPackage": {
            "AccountID": null
        },
        "c": {
            "ac_text": null,
            "ac_text_url": null,
            "ac_text_email": null,
            "ac_text_phone": null,
            "ac_date": null,
            "ac_time": null,
            "ac_integer": null,
            "ac_menu": null,
            "ac_radio": null,
            "ac_area": null,
            "ac_display": null,
            "ac_novis": null,
            "ac_special_menu": null,
            "ac_max_menu": null,
            "ac_folder_text": "4061234567",
            "ac_folder_text_url": "http://example.com",
            "ac_folder_text_email": "nobody@example.com",
            "ac_folder_text_phone": "4065224200",
            "ac_folder_date": null,
            "ac_folder_time": null,
            "ac_folder_integer": 26,
            "ac_folder_menu": {
                "id": 47,
                "lookupName": "Dolphin"
            },
            "ac_folder_yes_no": null
        }
    },
    "displayName": "Administrator",
    "emailNotification": null,
    "emails": {
        "links": [
            {
            "rel": "self",
            "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1/emails"
            }
        ]
    },
    "login": "administrator",
    "manager": null,
    "name": {
        "first": "Administrator",
        "last": "-"
    },
    "nameFurigana": {
        "first": null,
        "last": null
    },
    "notificationPending": false,
    "passwordExpirationTime": "2020-12-31T09:00:00.000Z",
    "phones": {
        "links": [
            {
            "rel": "self",
            "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1/phones"
            }
        ]
    },
    "profile": {
        "id": 1,
        "lookupName": "Full Access"
    },
    "salesSettings": {
        "defaultCurrency": {
            "id": 1,
            "lookupName": "USD"
        },
        "territory": null
    },
    "serviceSettings": {},
    "signature": null,
    "staffGroup": null,
    "links": [
        {
        "rel": "self",
        "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1"
        },
        {
        "rel": "canonical",
        "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1"
        },
        {
        "rel": "describedby",
        "href": "https://mysite.example.com/services/rest/connect/v1.4/metadata-catalog/accounts"
        },
        {
        "rel": "alternate",
        "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1",
        "mediaType": "application/schema+json"
        }
    ]
}

Example with Null Data Excluded

This example shows account information with null data excluded using the prefer header. Using the same GET request as in Example with All Data, but with the prefer header set to exclude-null-properties, returns the following results.

Note:

Attributes with a value of false are also excluded.
{
    "id": 1,
    "lookupName": "Administrator -",
    "accountHierarchy": {
        "links": [
        {
            "rel": "self",
            "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1/accountHierarchy"
            }
        ]
    },
    "attributes": {
        "staffAssignmentDisabled": true,
        viewsReportsDisabled": true
        },
    "customFields": {
        "CO": {},
        "CustParent": {},
        "SelfPackage": {},
        "c": {
            "ac_folder_text": "4061234567",
            "ac_folder_text_url": "http://example.com",
            "ac_folder_text_email": "nobody@example.com",
            "ac_folder_text_phone": "4065224200",
            "ac_folder_integer": 26,
            "ac_folder_menu": {
                "id": 47,
                "lookupName": "Dolphin"
                }
            }
    },
    "displayName": "Administrator",
    "emails": {
        "links": [
            {
            "rel": "self",
            "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1/emails"
            }
        ]
    },
    "login": "administrator",
    "name": {
        "first": "Administrator",
        "last": "-"
    },
    "nameFurigana": {},
    "passwordExpirationTime": "2020-12-31T09:00:00.000Z",
    "phones": {
        "links": [
            {
            "rel": "self",
            "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1/phones"
            }
        ]
    },
    "profile": {
        "id": 1,
        "lookupName": "Full Access"
    },
    "salesSettings": {
        defaultCurrency": {
            "id": 1,
            "lookupName": "USD"
        }
    },
    "serviceSettings": {},
    "links": [
        {
        "rel": "self",
        "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1"
        },
        {
        "rel": "canonical",
        "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1"
        },
        {
        "rel": "describedby",
        "href": "https://mysite.example.com/services/rest/connect/v1.4/metadata-catalog/accounts"
        },
        {
        "rel": "alternate",
        "href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1",
        "mediaType": "application/schema+json"
        }
    ]
}