Create a Custom Field
1 min
POST
https://api.nue.io/cpq/objects/{objectName}/custom-fields
Path Parameters
- objectNamestringrequiredDescription
Header Parameters
- acceptstringDescriptionDefaultapplication/jsonAllowedapplication/json*/*
Body Parameters
- bodyCreateCustomFieldRequestrequired
- namestringrequiredDescriptionMin Length0Max Length40
- labelstringDescriptionMin Length0Max Length40
- typestring<Text | LongTextArea | Checkbox | Number | Currency | Percent | Date | DateTime | Email | Phone | Url | Picklist | MultiselectPicklist>requiredDescriptionAllowedTextLongTextAreaCheckboxNumberCurrencyPercentDateDateTimeEmailPhoneUrlPicklistMultiselectPicklist
- lengthinteger<int32>DescriptionFormatint32
- precisioninteger<int32>DescriptionFormatint32
- scaleinteger<int32>DescriptionFormatint32
- visibleLinesinteger<int32>DescriptionFormatint32
- picklistValuesPicklistValueRequest[]Description
- valuestringrequiredDescription
- labelstringDescription
- descriptionstringDescriptionMin Length0Max Length255
- inlineHelpTextstringDescriptionMin Length0Max Length255
- requiredbooleanDescription
- defaultValuestringDescription
- fieldSetsstring[]Example
[ "Nue Custom Fields" ]
Description - permissionSetIdsstring[]Description
- permissionSetNamesstring[]Example
[ "Deal Desk" ]
Description - readablebooleanDescription
- editablebooleanDescription
Responses
201
- CreateCustomFieldResponse
- objectNamestringDescription
- fieldApiNamestringDescription
- fieldCreatedbooleanDescription
- fieldExistedbooleanDescription
- addedToFieldSetbooleanDescription
- syncedToNuebooleanDescription
- fieldPermissionsGrantedbooleanDescription
- visibleToNuebooleanDescription
- fieldSetOutcomesmap<string, string>Description
- fieldSetsJoinedstring[]Description
- warningsstring[]Description
400
404
501
curl
curl --request POST \
--url https://api.nue.io/cpq/objects/{objectName}/custom-fields \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"name": "",
"type": "",
"picklistValues": [
{
"value": ""
}
]
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"name": "",
"type": "",
"picklistValues": [
{
"value": ""
}
]
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.nue.io/cpq/objects/{objectName}/custom-fields", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.nue.io/cpq/objects/{objectName}/custom-fields")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"name": "",
"type": "",
"picklistValues": [
{
"value": ""
}
]
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.nue.io/cpq/objects/{objectName}/custom-fields"
payload = json.dumps({
"name": "",
"type": "",
"picklistValues": [
{
"value": ""
}
]
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
201
// The field exists on the object and Nue has been synchronized
{
"objectName": "",
"fieldApiName": "",
"fieldCreated": false,
"fieldExisted": false,
"addedToFieldSet": false,
"syncedToNue": false,
"fieldPermissionsGranted": false,
"visibleToNue": false,
"fieldSetOutcomes": "",
"fieldSetsJoined": [
""
],
"warnings": [
""
]
}400
// The object is not one Nue synchronizes custom fields for, the field definition is incomplete for its type, or Salesforce refused to create the field
404
// Not Found
501
// The tenant is not Salesforce-integrated