Search.../
  1. REST
Generate a test token to explore our APIs

Query Labels

Developer Preview

Retrieves a list of contact labels. Up to 500 labels can be returned per request.

For a detailed list of supported operations, see sorting and filtering for labels. To learn how to query labels, see API Query Language.

Syntax

function QueryLabels(query: _com_wixpress_contacts_labels_v4_upstream_wix_query_Query, language: string): QueryLabels<_com_wixpress_contacts_labels_v4_QueryLabelsResponse>

Query Labels Parameters

NAME
TYPE
DESCRIPTION
query
object

Query options.

language
string

Language for localization.

Returns

Return Type:

object
NAME
TYPE
DESCRIPTION
labels
Array<object>

List of labels

pagingMetadata
object

Details on the paged set of results returned.

Was this helpful?

Query All Labels

Request

curl

Copy Code
1curl -X POST \
2 'https://www.wixapis.com/contacts/v4/labels/query' \
3 -H 'Authorization: <AUTH>'

Response

json

1{
2 "labels": [
3 {
4 "namespace": "custom",
5 "namespaceDisplayName": "Labels",
6 "key": "custom.my-label",
7 "displayName": "My Label",
8 "labelType": "USER_DEFINED",
9 "createdDate": "2020-04-20T14:02:20Z",
10 "updatedDate": "2020-04-20T14:02:20Z"
11 },
12 {
13 "namespace": "custom",
14 "namespaceDisplayName": "Labels",
15 "key": "custom.another-label",
16 "displayName": "Another Label",
17 "labelType": "USER_DEFINED",
18 "createdDate": "2021-04-20T14:02:20Z",
19 "updatedDate": "2021-04-20T14:02:20Z"
20 },
21 {
22 "namespace": "contacts",
23 "namespaceDisplayName": "Labels",
24 "key": "contacts.customers",
25 "displayName": "Customers",
26 "labelType": "SYSTEM"
27 },
28 {
29 "namespace": "contacts",
30 "namespaceDisplayName": "Labels",
31 "key": "contacts.contacted-me",
32 "displayName": "Contacted Me",
33 "labelType": "SYSTEM"
34 }
35 ],
36 "metadata": {
37 "count": 4,
38 "offset": 0,
39 "total": 4
40 }
41}
Query Labels by Namespace Sorted by CreatedDate Desc
Query Labels by Keys