Supported Query Parameters
You can use query parameters to specify various conditions for retrieving REST resource records. Let's familiarize ourselves with the available query parameters and look at some examples:
- Query Parameters
- Resource Example for fields Parameter
- Object Example for fields Parameter
- Example for links Parameter
Query Parameters
You can use the following query parameters in the Connect REST API.
Parameter | Description |
---|---|
download |
Supported only with the fileAttachment resource, for example, see Download Individual File Attachments. |
expand |
Returns a fully expanded version of a particular subresource. See Examples of GET. |
fields |
Returns only the specified, comma-separated list of fields for collection resources, such as incidents or contacts, or for individual objects. The
Note: Queries on subfields, such as name.first, only work with individual resources and not with collections. |
limit |
Sets the page size. See Paginating. |
links |
Returns only the specified, comma-separated set of links for a particular object. Use GET with the following query syntax:
|
offset |
Determines the record number from which to start retrieval. See Paginating. |
orderBy |
Determines the sort order of results. See Sorting. |
q |
|
query |
Supported only with the queryResults resource. See Run ROQL Tabular Queries. |
totalResults |
Lets you display the total number of results. See Paginating. |
Resource Example for fields Parameter
You can retrieve the display name and login details for the accounts resource as follows.
Example URL
Here's the complete URL with the GET HTTP method.
GET
https://mysite.example.com/services/rest/connect/v1.4/accounts?fields=displayName,login
Example Response
Here's an example of the response body in JSON format.
{
"items": [
{
"id": 1,
"lookupName": "Administrator -",
"displayName": "Administrator",
"login": "administrator",
"links": [
{
"rel": "canonical",
"href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/1"
}
]
},
{
"id": 3,
"lookupName": "Lucy Bauer",
"displayName": "Lucy Bauer",
"login": "lbauer",
"links": [
{
"rel": "canonical",
"href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/3"
}
]
},
...
{
"id": 17,
"lookupName": "Abby Parker",
"displayName": "Abby Parker",
"login": "aparker",
"links": [
{
"rel": "canonical",
"href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/17"
}
]
}
],
"hasMore": false,
"links": [
{
"rel": "canonical",
"href": "https://mysite.example.com/services/rest/connect/v1.4/accounts"
},
{
"rel": "describedby",
"href": "https://mysite.example.com/services/rest/connect/v1.4/metadata-catalog/accounts",
"mediaType": "application/schema+json"
},
{
"rel": "search-form",
"href": "https://mysite.example.com/services/rest/connect/v1.4/accounts-search-form"
},
{
"rel": "self",
"href": "https://mysite.example.com/services/rest/connect/v1.4/accounts?fields=displayName,login"
}
]
}
Object Example for fields Parameter
You can retrieve records with the ID, lookup name, first name in the name object, and profile for the accounts resource as follows.
Example URL
Here's the complete URL with the GET HTTP method.
GET
https://mysite.example.com/services/rest/connect/v1.4/accounts/7
?fields=id,lookupName,name.first,profile
Example Response
Here's an example of the response body in JSON format.
{
"id": 7,
"lookupName": "George Hewitt",
"name": {
"first": "George"
},
"profile": {
"id": 12,
"lookupName": "Customer Support Manager"
},
"links": [
{
...
}
]
}
Example for links Parameter
You can retrieve records with the links for the accounts resource as follows.
Example URL
Here's the complete URL with the GET HTTP method.
GET
https://mysite.example.com/services/rest/connect/v1.4/accounts/7?links=self,alternate
Example Response
Here's an example of the response body in JSON format.
{
"id": 7,
"lookupName": "George Hewitt",
...
"signature": null,
"staffGroup": {
"id": 100022,
"lookupName": "Customer Support - Tier 1"
},
"links": [
{
"rel": "self",
"href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/7"
},
{
"rel": "alternate",
"href": "https://mysite.example.com/services/rest/connect/v1.4/accounts/7",
"mediaType": "application/schema+json"
}
]
}