Update an audit template (project-scoped path)
curl --request PATCH \
--url https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"groupId": "<string>",
"isPublished": true,
"auditType": "<string>",
"tags": [
"<string>"
],
"answeredStatusEnabled": true,
"participants": {},
"recurrentAuditInfo": {},
"questions": [
{
"categoryName": "<string>",
"questions": [
{
"question": "<string>",
"settings": {
"answer": [
"<string>"
],
"richOptions": [
{
"id": "<string>",
"text": "<string>",
"image": "<string>"
}
],
"ticketRequired": true,
"isAttachmentMandatory": true,
"attachments": [
"<string>"
],
"weightingfactor": 123,
"styling": {
"options": {}
}
},
"answer": [
"<unknown>"
],
"ticket": [
"<string>"
],
"description": "<string>"
}
],
"settings": {
"duplicate": true
}
}
],
"_attachments": {}
}
'import requests
url = "https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}"
payload = {
"name": "<string>",
"groupId": "<string>",
"isPublished": True,
"auditType": "<string>",
"tags": ["<string>"],
"answeredStatusEnabled": True,
"participants": {},
"recurrentAuditInfo": {},
"questions": [
{
"categoryName": "<string>",
"questions": [
{
"question": "<string>",
"settings": {
"answer": ["<string>"],
"richOptions": [
{
"id": "<string>",
"text": "<string>",
"image": "<string>"
}
],
"ticketRequired": True,
"isAttachmentMandatory": True,
"attachments": ["<string>"],
"weightingfactor": 123,
"styling": { "options": {} }
},
"answer": ["<unknown>"],
"ticket": ["<string>"],
"description": "<string>"
}
],
"settings": { "duplicate": True }
}
],
"_attachments": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
groupId: '<string>',
isPublished: true,
auditType: '<string>',
tags: ['<string>'],
answeredStatusEnabled: true,
participants: {},
recurrentAuditInfo: {},
questions: [
{
categoryName: '<string>',
questions: [
{
question: '<string>',
settings: {
answer: ['<string>'],
richOptions: [{id: '<string>', text: '<string>', image: '<string>'}],
ticketRequired: true,
isAttachmentMandatory: true,
attachments: ['<string>'],
weightingfactor: 123,
styling: {options: {}}
},
answer: ['<unknown>'],
ticket: ['<string>'],
description: '<string>'
}
],
settings: {duplicate: true}
}
],
_attachments: {}
})
};
fetch('https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'groupId' => '<string>',
'isPublished' => true,
'auditType' => '<string>',
'tags' => [
'<string>'
],
'answeredStatusEnabled' => true,
'participants' => [
],
'recurrentAuditInfo' => [
],
'questions' => [
[
'categoryName' => '<string>',
'questions' => [
[
'question' => '<string>',
'settings' => [
'answer' => [
'<string>'
],
'richOptions' => [
[
'id' => '<string>',
'text' => '<string>',
'image' => '<string>'
]
],
'ticketRequired' => true,
'isAttachmentMandatory' => true,
'attachments' => [
'<string>'
],
'weightingfactor' => 123,
'styling' => [
'options' => [
]
]
],
'answer' => [
'<unknown>'
],
'ticket' => [
'<string>'
],
'description' => '<string>'
]
],
'settings' => [
'duplicate' => true
]
]
],
'_attachments' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"isPublished\": true,\n \"auditType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"answeredStatusEnabled\": true,\n \"participants\": {},\n \"recurrentAuditInfo\": {},\n \"questions\": [\n {\n \"categoryName\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"settings\": {\n \"answer\": [\n \"<string>\"\n ],\n \"richOptions\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"image\": \"<string>\"\n }\n ],\n \"ticketRequired\": true,\n \"isAttachmentMandatory\": true,\n \"attachments\": [\n \"<string>\"\n ],\n \"weightingfactor\": 123,\n \"styling\": {\n \"options\": {}\n }\n },\n \"answer\": [\n \"<unknown>\"\n ],\n \"ticket\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n }\n ],\n \"settings\": {\n \"duplicate\": true\n }\n }\n ],\n \"_attachments\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.patch("https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"isPublished\": true,\n \"auditType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"answeredStatusEnabled\": true,\n \"participants\": {},\n \"recurrentAuditInfo\": {},\n \"questions\": [\n {\n \"categoryName\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"settings\": {\n \"answer\": [\n \"<string>\"\n ],\n \"richOptions\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"image\": \"<string>\"\n }\n ],\n \"ticketRequired\": true,\n \"isAttachmentMandatory\": true,\n \"attachments\": [\n \"<string>\"\n ],\n \"weightingfactor\": 123,\n \"styling\": {\n \"options\": {}\n }\n },\n \"answer\": [\n \"<unknown>\"\n ],\n \"ticket\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n }\n ],\n \"settings\": {\n \"duplicate\": true\n }\n }\n ],\n \"_attachments\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"isPublished\": true,\n \"auditType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"answeredStatusEnabled\": true,\n \"participants\": {},\n \"recurrentAuditInfo\": {},\n \"questions\": [\n {\n \"categoryName\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"settings\": {\n \"answer\": [\n \"<string>\"\n ],\n \"richOptions\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"image\": \"<string>\"\n }\n ],\n \"ticketRequired\": true,\n \"isAttachmentMandatory\": true,\n \"attachments\": [\n \"<string>\"\n ],\n \"weightingfactor\": 123,\n \"styling\": {\n \"options\": {}\n }\n },\n \"answer\": [\n \"<unknown>\"\n ],\n \"ticket\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n }\n ],\n \"settings\": {\n \"duplicate\": true\n }\n }\n ],\n \"_attachments\": {}\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"groupId": "<string>",
"group": "<string>",
"project": "<string>",
"isPublished": true,
"archived": "<string>",
"auditType": "<string>",
"answeredStatusEnabled": true,
"tags": [
"<string>"
],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z"
},
"author": {
"email": "jsmith@example.com",
"type": "<string>"
},
"lastmodifier": {
"email": "jsmith@example.com",
"type": "<string>"
},
"versionInfo": {},
"_attachments": {},
"questions": [
{
"categoryName": "<string>",
"questions": [
{
"question": "<string>",
"settings": {
"answertype": "yesnona",
"choice": "single",
"answer": [
"<string>"
],
"richOptions": [
{
"id": "<string>",
"type": "textselect",
"text": "<string>",
"image": "<string>"
}
],
"ticketRequired": true,
"isAttachmentMandatory": true,
"attachments": [
"<string>"
],
"weightingfactor": 123,
"styling": {
"options": {}
}
},
"answer": [
"<unknown>"
],
"ticket": [
"<string>"
],
"description": "<string>"
}
],
"settings": {
"duplicate": true
}
}
]
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}Audit Templates
Update an audit template (project-scoped path)
The same endpoint as
PATCH /api/v2/data/audittemplates/{database}/{auditTemplateId}, on
the canonical project-scoped path. One handler answers both, and both
are supported indefinitely.
See the other path for what is merged, what is ignored, and how
If-Match behaves.
PATCH
/
api
/
v2
/
data
/
projects
/
{database}
/
audittemplates
/
{auditTemplateId}
Update an audit template (project-scoped path)
curl --request PATCH \
--url https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"groupId": "<string>",
"isPublished": true,
"auditType": "<string>",
"tags": [
"<string>"
],
"answeredStatusEnabled": true,
"participants": {},
"recurrentAuditInfo": {},
"questions": [
{
"categoryName": "<string>",
"questions": [
{
"question": "<string>",
"settings": {
"answer": [
"<string>"
],
"richOptions": [
{
"id": "<string>",
"text": "<string>",
"image": "<string>"
}
],
"ticketRequired": true,
"isAttachmentMandatory": true,
"attachments": [
"<string>"
],
"weightingfactor": 123,
"styling": {
"options": {}
}
},
"answer": [
"<unknown>"
],
"ticket": [
"<string>"
],
"description": "<string>"
}
],
"settings": {
"duplicate": true
}
}
],
"_attachments": {}
}
'import requests
url = "https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}"
payload = {
"name": "<string>",
"groupId": "<string>",
"isPublished": True,
"auditType": "<string>",
"tags": ["<string>"],
"answeredStatusEnabled": True,
"participants": {},
"recurrentAuditInfo": {},
"questions": [
{
"categoryName": "<string>",
"questions": [
{
"question": "<string>",
"settings": {
"answer": ["<string>"],
"richOptions": [
{
"id": "<string>",
"text": "<string>",
"image": "<string>"
}
],
"ticketRequired": True,
"isAttachmentMandatory": True,
"attachments": ["<string>"],
"weightingfactor": 123,
"styling": { "options": {} }
},
"answer": ["<unknown>"],
"ticket": ["<string>"],
"description": "<string>"
}
],
"settings": { "duplicate": True }
}
],
"_attachments": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
groupId: '<string>',
isPublished: true,
auditType: '<string>',
tags: ['<string>'],
answeredStatusEnabled: true,
participants: {},
recurrentAuditInfo: {},
questions: [
{
categoryName: '<string>',
questions: [
{
question: '<string>',
settings: {
answer: ['<string>'],
richOptions: [{id: '<string>', text: '<string>', image: '<string>'}],
ticketRequired: true,
isAttachmentMandatory: true,
attachments: ['<string>'],
weightingfactor: 123,
styling: {options: {}}
},
answer: ['<unknown>'],
ticket: ['<string>'],
description: '<string>'
}
],
settings: {duplicate: true}
}
],
_attachments: {}
})
};
fetch('https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'groupId' => '<string>',
'isPublished' => true,
'auditType' => '<string>',
'tags' => [
'<string>'
],
'answeredStatusEnabled' => true,
'participants' => [
],
'recurrentAuditInfo' => [
],
'questions' => [
[
'categoryName' => '<string>',
'questions' => [
[
'question' => '<string>',
'settings' => [
'answer' => [
'<string>'
],
'richOptions' => [
[
'id' => '<string>',
'text' => '<string>',
'image' => '<string>'
]
],
'ticketRequired' => true,
'isAttachmentMandatory' => true,
'attachments' => [
'<string>'
],
'weightingfactor' => 123,
'styling' => [
'options' => [
]
]
],
'answer' => [
'<unknown>'
],
'ticket' => [
'<string>'
],
'description' => '<string>'
]
],
'settings' => [
'duplicate' => true
]
]
],
'_attachments' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"isPublished\": true,\n \"auditType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"answeredStatusEnabled\": true,\n \"participants\": {},\n \"recurrentAuditInfo\": {},\n \"questions\": [\n {\n \"categoryName\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"settings\": {\n \"answer\": [\n \"<string>\"\n ],\n \"richOptions\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"image\": \"<string>\"\n }\n ],\n \"ticketRequired\": true,\n \"isAttachmentMandatory\": true,\n \"attachments\": [\n \"<string>\"\n ],\n \"weightingfactor\": 123,\n \"styling\": {\n \"options\": {}\n }\n },\n \"answer\": [\n \"<unknown>\"\n ],\n \"ticket\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n }\n ],\n \"settings\": {\n \"duplicate\": true\n }\n }\n ],\n \"_attachments\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.patch("https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"isPublished\": true,\n \"auditType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"answeredStatusEnabled\": true,\n \"participants\": {},\n \"recurrentAuditInfo\": {},\n \"questions\": [\n {\n \"categoryName\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"settings\": {\n \"answer\": [\n \"<string>\"\n ],\n \"richOptions\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"image\": \"<string>\"\n }\n ],\n \"ticketRequired\": true,\n \"isAttachmentMandatory\": true,\n \"attachments\": [\n \"<string>\"\n ],\n \"weightingfactor\": 123,\n \"styling\": {\n \"options\": {}\n }\n },\n \"answer\": [\n \"<unknown>\"\n ],\n \"ticket\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n }\n ],\n \"settings\": {\n \"duplicate\": true\n }\n }\n ],\n \"_attachments\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://web.edcontrols.com/api/v2/data/projects/{database}/audittemplates/{auditTemplateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"groupId\": \"<string>\",\n \"isPublished\": true,\n \"auditType\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"answeredStatusEnabled\": true,\n \"participants\": {},\n \"recurrentAuditInfo\": {},\n \"questions\": [\n {\n \"categoryName\": \"<string>\",\n \"questions\": [\n {\n \"question\": \"<string>\",\n \"settings\": {\n \"answer\": [\n \"<string>\"\n ],\n \"richOptions\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"image\": \"<string>\"\n }\n ],\n \"ticketRequired\": true,\n \"isAttachmentMandatory\": true,\n \"attachments\": [\n \"<string>\"\n ],\n \"weightingfactor\": 123,\n \"styling\": {\n \"options\": {}\n }\n },\n \"answer\": [\n \"<unknown>\"\n ],\n \"ticket\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n }\n ],\n \"settings\": {\n \"duplicate\": true\n }\n }\n ],\n \"_attachments\": {}\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"groupId": "<string>",
"group": "<string>",
"project": "<string>",
"isPublished": true,
"archived": "<string>",
"auditType": "<string>",
"answeredStatusEnabled": true,
"tags": [
"<string>"
],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z"
},
"author": {
"email": "jsmith@example.com",
"type": "<string>"
},
"lastmodifier": {
"email": "jsmith@example.com",
"type": "<string>"
},
"versionInfo": {},
"_attachments": {},
"questions": [
{
"categoryName": "<string>",
"questions": [
{
"question": "<string>",
"settings": {
"answertype": "yesnona",
"choice": "single",
"answer": [
"<string>"
],
"richOptions": [
{
"id": "<string>",
"type": "textselect",
"text": "<string>",
"image": "<string>"
}
],
"ticketRequired": true,
"isAttachmentMandatory": true,
"attachments": [
"<string>"
],
"weightingfactor": 123,
"styling": {
"options": {}
}
},
"answer": [
"<unknown>"
],
"ticket": [
"<string>"
],
"description": "<string>"
}
],
"settings": {
"duplicate": true
}
}
]
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}Authorizations
Path Parameters
Body
application/json
Only the merged fields are listed. Anything else in the body is ignored
rather than rejected (except a wrong type, which is a 422). Omit a
field to keep it: null is refused on every field except
recurrentAuditInfo.
Response
The stored audit template document, with the new _rev.
