Reorder the questions
Sets the order the questions are asked in. Send every question on the form, once each, in the new order; anything else is refused. Needs write on the area of the form’s kind.
PUT
https://{organization}.rescueconsole.com
/
api
/
forms
/
{id}
/
fields
/
order
Reorder the questions
curl --request PUT \
--url https://{organization}.rescueconsole.com/api/forms/{id}/fields/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"0b6f2e1c-3d4a-4c5b-8e7f-1a2b3c4d5e6f",
"7e8d9c0b-1a2f-4e3d-9c8b-6a5f4e3d2c1b",
"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ids: [
'0b6f2e1c-3d4a-4c5b-8e7f-1a2b3c4d5e6f',
'7e8d9c0b-1a2f-4e3d-9c8b-6a5f4e3d2c1b',
'c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f'
]
})
};
fetch('https://{organization}.rescueconsole.com/api/forms/{id}/fields/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/forms/{id}/fields/order"
payload = { "ids": ["0b6f2e1c-3d4a-4c5b-8e7f-1a2b3c4d5e6f", "7e8d9c0b-1a2f-4e3d-9c8b-6a5f4e3d2c1b", "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"form": {
"id": "<string>",
"slug": "<string>",
"title": "<string>",
"form_kind": "adoption_application",
"is_published": true,
"description": "<string>",
"layout_mode": "inline",
"success_message": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"fields": [
{
"id": "<string>",
"field_key": "<string>",
"label": "<string>",
"field_type": "text",
"options": [
"<string>"
],
"required": true,
"help_text": "<string>",
"sort_order": 123,
"section": "<string>",
"show_when": "<string>"
}
]
}
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}Authorizations
Body
application/json
⌘I
Reorder the questions
curl --request PUT \
--url https://{organization}.rescueconsole.com/api/forms/{id}/fields/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"0b6f2e1c-3d4a-4c5b-8e7f-1a2b3c4d5e6f",
"7e8d9c0b-1a2f-4e3d-9c8b-6a5f4e3d2c1b",
"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ids: [
'0b6f2e1c-3d4a-4c5b-8e7f-1a2b3c4d5e6f',
'7e8d9c0b-1a2f-4e3d-9c8b-6a5f4e3d2c1b',
'c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f'
]
})
};
fetch('https://{organization}.rescueconsole.com/api/forms/{id}/fields/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/forms/{id}/fields/order"
payload = { "ids": ["0b6f2e1c-3d4a-4c5b-8e7f-1a2b3c4d5e6f", "7e8d9c0b-1a2f-4e3d-9c8b-6a5f4e3d2c1b", "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"form": {
"id": "<string>",
"slug": "<string>",
"title": "<string>",
"form_kind": "adoption_application",
"is_published": true,
"description": "<string>",
"layout_mode": "inline",
"success_message": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"fields": [
{
"id": "<string>",
"field_key": "<string>",
"label": "<string>",
"field_type": "text",
"options": [
"<string>"
],
"required": true,
"help_text": "<string>",
"sort_order": 123,
"section": "<string>",
"show_when": "<string>"
}
]
}
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}
