Rename a custom field or change its options
curl --request PATCH \
--url https://public-api.hyperlocalise.com/v1/custom-fields/{fieldId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"options": [
{
"value": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
options: [{value: '<string>', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}]
})
};
fetch('https://public-api.hyperlocalise.com/v1/custom-fields/{fieldId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.hyperlocalise.com/v1/custom-fields/{fieldId}"
payload = {
"name": "<string>",
"description": "<string>",
"options": [
{
"value": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.hyperlocalise.com/v1/custom-fields/{fieldId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"customField": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"description": "<string>",
"type": "text",
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Custom fields
Rename a custom field or change its options
Requires custom-fields:write. options is the field’s whole option list, in display order: an entry with id keeps that option (renamed to value, so projects that chose it keep it), an entry without id adds one, and options left out are removed, along with every project’s choice of them.
PATCH
https://public-api.hyperlocalise.com
/
v1
/
custom-fields
/
{fieldId}
Rename a custom field or change its options
curl --request PATCH \
--url https://public-api.hyperlocalise.com/v1/custom-fields/{fieldId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"options": [
{
"value": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
'const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
options: [{value: '<string>', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}]
})
};
fetch('https://public-api.hyperlocalise.com/v1/custom-fields/{fieldId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.hyperlocalise.com/v1/custom-fields/{fieldId}"
payload = {
"name": "<string>",
"description": "<string>",
"options": [
{
"value": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.hyperlocalise.com/v1/custom-fields/{fieldId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"customField": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"description": "<string>",
"type": "text",
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Body
application/json
Was this page helpful?

