Create custom field
POST
https://api.catenda.com/v2/projects/{project-id}/custom-fields
Path Parameters
- project-idstringrequiredExampleDescription
Body Parameters
- bodyobjectrequired
- namestringrequiredExampleDescription
- descriptionstringrequiredExampleDescription
- typestring<text | integer | double | enumeration | date>requiredExampleDescription
Responses
200
- custom-fieldDescription
- idstringExampleDescription
- namestringExampleDescription
- descriptionstringExampleDescription
- typestring<text | integer | double | enumeration | date>ExampleDescription
- createdAtstringExampleDescription
- createdBystringExampleDescription
- archivedbooleanDescription
- dropdownItemsobject[]Description
- idstringDescription
- namestringExampleDescription
- codestringExampleDescription
- disabledbooleanDescription
curl
curl --request POST \
--url https://api.catenda.com/v2/projects/{project-id}/custom-fields \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"name": "Custom field 1",
"description": "Custom field description",
"type": "text"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"name": "Custom field 1",
"description": "Custom field description",
"type": "text"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.catenda.com/v2/projects/{project-id}/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.catenda.com/v2/projects/{project-id}/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": "Custom field 1",
"description": "Custom field description",
"type": "text"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.catenda.com/v2/projects/{project-id}/custom-fields"
payload = json.dumps({
"name": "Custom field 1",
"description": "Custom field description",
"type": "text"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// OK
{
"id": "324409076a694255b589d236517a55da",
"name": "Custom field name",
"description": "Custom field description",
"type": "text",
"createdAt": "2023-03-06T11:52:45.000Z",
"createdBy": "624809076a694255b989d236517a55da",
"archived": false,
"dropdownItems": [
{
"id": "",
"name": "Dropdown item 1",
"code": "Item name",
"disabled": false
}
]
}