Get a Published Form
Returns the fields of the published form at this slug, in order, for a client to render. A draft or closed form answers 404.
post
/forms/get-publishedcurl --request POST \
--url 'https://api.tries.care/forms/get-published' \
--header 'Content-Type: application/json' \
--data '{
"slug": "string"
}'const response = await fetch("https://api.tries.care/forms/get-published", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
"slug": "string"
}),
});
const data = await response.json();{
"slug": "string",
"title": "string",
"description": "string",
"access": "anyone",
"fields": [
{
"key": "string",
"kind": "text",
"label": "string",
"help": "string",
"required": true,
"options": [
{
"value": "string",
"label": "string"
}
]
}
]
}Body Parameters
application/jsonslugstringrequiredlength ≤ 60
Responses
- 200PublishedFormViewapplication/json
slugstringrequiredlength ≤ 60
titlestringrequireddescriptionstringnullablerequiredaccessenum<string>requiredValues:"anyone""signed-in"
fieldsobject[]requiredProperties (6)
keystringrequiredkindenum<string>requiredValues:"text""textarea""email""phone""radio""checkboxes""select""checkbox"
labelstringrequiredhelpstringnullablerequiredrequiredbooleanrequiredoptionsobject[]requiredProperties (2)
valuestringrequiredlabelstringrequired
- 404FormNotFoundErrorapplication/json
_tagenum<string>requiredformstringrequired
- 500DatabaseErrorapplication/json
_tagenum<string>requiredmessagestringrequired