Custom Fields endpoints
The Customfields endpoints enable you to retrieve, update or delete already created custom fields in a Quantive Results account, as well as create new ones. Once created a custom field automatically appears in the UI for all the types it's been defined to apply to.
When you create a custom field in Quantive Results you specify its label. This is what identifies the custom filed in the UI. When working with custom fields programaptically though, you must use the custom field name. The name is automatically generated and is not visible in the UI.
To get the programmatic name of a custom filed you must make a call to the getCustomFieldsv2 endpoint. It will return all custom fields defined in your Quantive Results account and the response contains the custom filed label as well as its name. Use the name value when you want to work with this custom field via API (e.g. set its value to something).
Name | Type | Description |
---|
200 | customFieldsResponse |
400 | bad request |
401 | unauthorized |
402 | payment required |
403 | forbidden |
500 | internal server error |
curl -X GET 'https://app.quantive.com/results/api/v2/customFields' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
var settings = { "url": "https://app.quantive.com/results/api/v2/customFields", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
NOTE: You must install the module requests.
In a terminal window do: pip install requests
import requests, json
headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };
url = "https://app.quantive.com/results/api/v2/customFields"
requests.get(url, headers = headers)
{
"items": [
{
"_id": "string value",
"accountId": "string value",
"dateCreated": "string value",
"description": "string value",
"filterable": false,
"isPrivate": false,
"label": "string value",
"lastModified": "string value",
"name": "string value",
"operationalType": "string value",
"orderId": 2,
"pluginVersionId": "string value",
"targetIds": [
"string value 1",
"string value 2"
],
"targetTypes": [
"string value 1",
"string value 2"
],
"tooltip": "string value",
"type": "string value",
"visualizationKind": "string value"
}
],
"targetTypes": [
"string value 1",
"string value 2"
],
"totalCount": 2
}
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | Specifies the ID of the gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
200 | customFieldsTypesResponse |
400 | bad request |
401 | unauthorized |
402 | payment required |
403 | forbidden |
500 | internal server error |
curl -X GET 'https://app.quantive.com/results/api/v1/customFields/supported-types' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
var settings = { "url": "https://app.quantive.com/results/api/v1/customFields/supported-types", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
NOTE: You must install the module requests.
In a terminal window do: pip install requests
import requests, json
headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };
url = "https://app.quantive.com/results/api/v1/customFields/supported-types"
requests.get(url, headers = headers)
{
"items": [
"string value 1",
"string value 2"
],
"totalCount": 2
}
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | Specifies the ID of the gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
id * | string | Specifies the ID of the custom field. expected in path, sample value: 5be26318e5274a0007f17f61 |
200 | customFieldResponse |
400 | bad request |
401 | unauthorized |
402 | payment required |
403 | forbidden |
500 | internal server error |
curl -X GET 'https://app.quantive.com/results/api/v1/customFields/{id}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
var settings = { "url": "https://app.quantive.com/results/api/v1/customFields/{id}", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
NOTE: You must install the module requests.
In a terminal window do: pip install requests
import requests, json
headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };
url = "https://app.quantive.com/results/api/v1/customFields/{id}"
requests.get(url, headers = headers)
{
"_id": "string value",
"accountId": "string value",
"dateCreated": "string value",
"description": "string value",
"filterable": false,
"isPrivate": false,
"label": "string value",
"lastModified": "string value",
"name": "string value",
"operationalType": "string value",
"orderId": 2,
"pluginVersionId": "string value",
"targetIds": [
"string value 1",
"string value 2"
],
"targetTypes": [
"string value 1",
"string value 2"
],
"tooltip": "string value",
"type": "string value",
"visualizationKind": "string value"
}
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | Specifies the ID of the gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
customField * | object | The object representing a custom field.
The 'name' field is used as a key for storage so it should be from 4 to 14 symbols, start with a lowercase letter and only contain letters, numbers and _.
The 'type' field currently supports: string, number, bool, date, array:[any of the aforementioned types]
The 'visualizationKind' field contains the name of the UI widget/component that will manage the custom field data. A good practice is to follow a naming convention for prefixing the visualizationKind like: gtmhub.textbox, gtmhub.textarea, gtmhub.number, gtmhub.checkbox, gtmhub.checkboxes, gtmhub.radiobuttons, gtmhub.address etc.
A 'filterable' field can be used for filtering queries.
The 'targetTypes' field lists type names that this custom field applies to. To get a list of all system types that support adding a custom field to, use the /customFields/supported-types endpoint.
The 'settings' field is used to add predefined values, validation etc.
Once created a custom field 'name' and 'type' can't be changed expected in body, sample value: { "_id": "string value", "description": "string value", "filterable": false, "label": "string value", "name": "string value", "operationalType": "string value", "orderId": 2, "targetIds": [ "string value 1", "string value 2" ], "targetTypes": [ "string value 1", "string value 2" ], "tooltip": "string value", "type": "string value", "visualizationKind": "string value" } |
201 | customFieldResponse |
400 | bad request |
401 | unauthorized |
402 | payment required |
403 | forbidden |
500 | internal server error |
curl -X POST 'https://app.quantive.com/results/api/v1/customFields' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"_id":"string value","description":"string value","filterable":false,"label":"string value","name":"string value","operationalType":"string value","orderId":2,"targetIds":["string value 1","string value 2"],"targetTypes":["string value 1","string value 2"],"tooltip":"string value","type":"string value","visualizationKind":"string value"}'
var body ={ "_id": "string value", "description": "string value", "filterable": false, "label": "string value", "name": "string value", "operationalType": "string value", "orderId": 2, "targetIds": [ "string value 1", "string value 2" ], "targetTypes": [ "string value 1", "string value 2" ], "tooltip": "string value", "type": "string value", "visualizationKind": "string value" };
var settings = { "url": "https://app.quantive.com/results/api/v1/customFields", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
NOTE: You must install the module requests.
In a terminal window do: pip install requests
import requests, json
headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };
url = "https://app.quantive.com/results/api/v1/customFields"
body = { "_id": "string value", "description": "string value", "filterable": false, "label": "string value", "name": "string value", "operationalType": "string value", "orderId": 2, "targetIds": [ "string value 1", "string value 2" ], "targetTypes": [ "string value 1", "string value 2" ], "tooltip": "string value", "type": "string value", "visualizationKind": "string value" };
requests.post(url, data=json.dumps(body), headers = headers)
{
"_id": "string value",
"accountId": "string value",
"dateCreated": "string value",
"description": "string value",
"filterable": false,
"isPrivate": false,
"label": "string value",
"lastModified": "string value",
"name": "string value",
"operationalType": "string value",
"orderId": 2,
"pluginVersionId": "string value",
"targetIds": [
"string value 1",
"string value 2"
],
"targetTypes": [
"string value 1",
"string value 2"
],
"tooltip": "string value",
"type": "string value",
"visualizationKind": "string value"
}
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | Specifies the ID of the gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
id * | string | Specifies the ID of the custom field. expected in path, sample value: 5be26318e5274a0007f17f61 |
customField * | object | The object representing a custom field.
The 'name' field is used as a key for storage so it should be from 4 to 14 symbols, start with a lowercase letter and only contain letters, numbers and _.
The 'type' field currently supports: string, number, bool, date, array:[any of the aforementioned types]
The 'visualizationKind' field contains the name of the UI widget/component that will manage the custom field data. A good practice is to follow a naming convention for prefixing the visualizationKind like: gtmhub.textbox, gtmhub.textarea, gtmhub.number, gtmhub.checkbox, gtmhub.checkboxes, gtmhub.radiobuttons, gtmhub.address etc.
A 'filterable' field can be used for filtering queries.
The 'targetTypes' field lists type names that this custom field applies to. To get a list of all system types that support adding a custom field to, use the /customFields/supported-types endpoint.
The 'settings' field is used to add predefined values, validation etc.
Once created a custom field 'name' and 'type' can't be changed expected in body, sample value: { "_id": "string value", "description": "string value", "filterable": false, "label": "string value", "name": "string value", "operationalType": "string value", "orderId": 2, "targetIds": [ "string value 1", "string value 2" ], "targetTypes": [ "string value 1", "string value 2" ], "tooltip": "string value", "type": "string value", "visualizationKind": "string value" } |
200 | customFieldResponse |
400 | bad request |
401 | unauthorized |
402 | payment required |
403 | forbidden |
500 | internal server error |
curl -X PUT 'https://app.quantive.com/results/api/v1/customFields/{id}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"_id":"string value","description":"string value","filterable":false,"label":"string value","name":"string value","operationalType":"string value","orderId":2,"targetIds":["string value 1","string value 2"],"targetTypes":["string value 1","string value 2"],"tooltip":"string value","type":"string value","visualizationKind":"string value"}'
var body ={ "_id": "string value", "description": "string value", "filterable": false, "label": "string value", "name": "string value", "operationalType": "string value", "orderId": 2, "targetIds": [ "string value 1", "string value 2" ], "targetTypes": [ "string value 1", "string value 2" ], "tooltip": "string value", "type": "string value", "visualizationKind": "string value" };
var settings = { "url": "https://app.quantive.com/results/api/v1/customFields/{id}", "method": "PUT", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
NOTE: You must install the module requests.
In a terminal window do: pip install requests
import requests, json
headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };
url = "https://app.quantive.com/results/api/v1/customFields/{id}"
body = { "_id": "string value", "description": "string value", "filterable": false, "label": "string value", "name": "string value", "operationalType": "string value", "orderId": 2, "targetIds": [ "string value 1", "string value 2" ], "targetTypes": [ "string value 1", "string value 2" ], "tooltip": "string value", "type": "string value", "visualizationKind": "string value" };
requests.put(url, data=json.dumps(body), headers = headers)
{
"_id": "string value",
"accountId": "string value",
"dateCreated": "string value",
"description": "string value",
"filterable": false,
"isPrivate": false,
"label": "string value",
"lastModified": "string value",
"name": "string value",
"operationalType": "string value",
"orderId": 2,
"pluginVersionId": "string value",
"targetIds": [
"string value 1",
"string value 2"
],
"targetTypes": [
"string value 1",
"string value 2"
],
"tooltip": "string value",
"type": "string value",
"visualizationKind": "string value"
}
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | Specifies the ID of the gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
id * | string | Specifies the ID of the custom field. expected in path, sample value: 5be26318e5274a0007f17f61 |
204 | no content |
400 | bad request |
401 | unauthorized |
402 | payment required |
403 | forbidden |
500 | internal server error |
curl -X DELETE 'https://app.quantive.com/results/api/v1/customFields/{id}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
var settings = { "url": "https://app.quantive.com/results/api/v1/customFields/{id}", "method": "DELETE", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
NOTE: You must install the module requests.
In a terminal window do: pip install requests
import requests, json
headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };
url = "https://app.quantive.com/results/api/v1/customFields/{id}"
requests.delete(url, headers = headers)
Oops! Looks like there are no API calls of that type for this Endpoint