Create or update evaluation form
1 min
POST
https://dev1.frontu.com//client/api/v2/evaluations/forms/
Body Parameters
- bodyobject
- guidstringDescription
- titlestringrequiredMax Length500
- taskTypestringDescription
- requiredbooleanDefaulttrue
- visiblebooleanDefaulttrue
- incidentbooleanDefaultfalse
- compliancebooleanDefaultfalse
- questionsobject[]
- guidstring
- titlestringrequiredMax Length500
- typeobjectrequired
- requiredbooleanDefaultfalse
- imageRequiredbooleanDefaultfalse
- orderIdinteger
- criteriasobject[]required
- guidstring
- titlestringrequiredMin Length1Max Length255
- customAnswerbooleanDefaultfalse
Responses
200
- object
201
- object
- titlestring
- taskTypestring
- deletedboolean
- publishedboolean
- visibleboolean
- requiredboolean
- versioninteger
- createdstring
- updatedstring
- guidstring
- questionsobject[]
- titlestring
- requiredboolean
- imageRequiredboolean
- orderIdinteger
- guidstring
- criteriasobject[]
- titlestring
- customAnswerboolean
- guidstring
400
- object
- errorsmap<string, string[]>
- dataobject
curl
curl --request POST \
--url https://dev1.frontu.com//client/api/v2/evaluations/forms/ \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"title": "",
"required": true,
"visible": true,
"questions": [
{
"title": "",
"type": "",
"criterias": [
{
"title": ""
}
]
}
]
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"title": "",
"required": true,
"visible": true,
"questions": [
{
"title": "",
"type": "",
"criterias": [
{
"title": ""
}
]
}
]
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://dev1.frontu.com//client/api/v2/evaluations/forms/", 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://dev1.frontu.com//client/api/v2/evaluations/forms/")
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({
"title": "",
"required": true,
"visible": true,
"questions": [
{
"title": "",
"type": "",
"criterias": [
{
"title": ""
}
]
}
]
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://dev1.frontu.com//client/api/v2/evaluations/forms/"
payload = json.dumps({
"title": "",
"required": True,
"visible": True,
"questions": [
{
"title": "",
"type": "",
"criterias": [
{
"title": ""
}
]
}
]
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Returned when an existing form was updated
{}201
// Returned when a new form was created
{
"title": "",
"taskType": "",
"deleted": false,
"published": false,
"visible": false,
"required": false,
"version": 0,
"created": "",
"updated": "",
"guid": "",
"questions": [
{
"title": "",
"required": false,
"imageRequired": false,
"orderId": 0,
"guid": "",
"criterias": [
{
"title": "",
"customAnswer": false,
"guid": ""
}
]
}
]
}400
// Validation failed
{
"errors": "",
"data": {}
}