Difference between revisions of "API Template Details"

From IVS Wiki
Jump to: navigation, search
(Created page with "This API call will return the details for a specified template. ===Resource URL=== <pre>http://valt.example.com/api/v3/admin/templates/{templateid}</pre> ''Replace {templatei...")
 
(No difference)

Latest revision as of 13:27, 14 April 2020

This API call will return the details for a specified template.

Resource URL

http://valt.example.com/api/v3/admin/templates/{templateid}

Replace {templateid} with the actual id number of the template. Templates are numbered sequentially when added to VALT.

Resource Information

Method GET
Response Type JSON
Authentication Required Yes

Parameters

No parameters can be passed to this call.

Response

Code Reason
200 Request Successful
401 Unauthorized
404 Template ID Not Found
JSON Response
data
id Template ID Number
name Template Name
type Template Type (Information, Marker, Evaluation or Email)
hidden True = Template is hidden from view, False = Template is visible in web gui.
entity name Default Field Name (Recording Name)
title Field name, if renamed.
value Default value, if specified.
type Type of Field (Text or Drop Down)
fields An array of JSON objects containing the properties of each field.
id Field ID number, specific to the given template.
on True = Field enabled and will appear, False = Field Disabled
required True = Field is a required field, False = Field is optional
type Field Type (Valid Values)
name Field Name
data Pre-populated/Default Values

Examples

Request

https://ivstest1.ad.ipivs.com/api/v3/admin/templates/35?access_token=e82632d19c523678fea3d1016c6df9e9

Successful Response

Sample response is shown with line breaks to make it more readable. Actual responses will not include line breaks.

{
"data":{
"id": 35,
"name": "Test Info Template API",
"type": "info",
"hidden": false,
"entity_name":{
"title": "",
"value": "",
"type": "Text"
},
"fields":[
{
"id": 146,
"on": true,
"required": false,
"type": "dropdown",
"name": "Drop Down",
"data": null
},
{
"id": 147,
"on": true,
"required": false,
"type": "audio",
"name": "Audio",
"data": null
},
{
"id": 148,
"on": true,
"required": false,
"type": "note",
"name": "Note",
"data": null
},
{
"id": 149,
"on": true,
"required": false,
"type": "quick_record",
"name": "Quick Record",
"data": null
},
{
"id": 150,
"on": true,
"required": false,
"type": "files",
"name": "File",
"data": null
},
{
"id": 151,
"on": true,
"required": false,
"type": "multi_select",
"name": "Multi",
"data": null
},
{
"id": 152,
"on": true,
"required": false,
"type": "text",
"name": "Text",
"data": null
}
]
}
}

Failure Response

Sample response is shown with line breaks to make it more readable. Actual responses will not include line breaks.

{
"error":{
"code": 404
}
}