API List Template Fields

From IVS Wiki
Revision as of 13:30, 14 April 2020 by IVSWikiBlue (talk | contribs) (Created page with "This API call will return a list of all fields for a specified template. ===Resource URL=== <pre>http://valt.example.com/api/v3/admin/templates/{templateid}/fields</pre> ''Re...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This API call will return a list of all fields for a specified template.

Resource URL

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

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
This API returns an array of JSON objects
id Field ID Number
on Field is Enabled (True or False)
required Field is Required (True or False)
type Field Type (Valid Values)
name Field Name
data Default Field Value

Examples

Request

https://ivstest1.ad.ipivs.com/api/v3/admin/templates/3/fields?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": 1,
"on": true,
"required": true,
"type": "text",
"name": "Case Number",
"data": null
},
{
"id": 2,
"on": true,
"required": false,
"type": "dropdown",
"name": "Charge",
"data": "Aggravated Assault / Battery,Aiding & Abetting / Accessory,Arson,Assault / Battery,Attempt,Bribery,Burglary,Child Abandonment,Child Abuse,Child Pornography,Computer Crime,Conspiracy,Credit / Debit Card Fraud,Criminal Contempt of Court,Cyber Bullying,Disorderly Conduct,Disturbing the Peace,Domestic Violence,Drug Manufacturing and Cultivation,Drug Possession,Drug Trafficking / Distribution,DUI / DWI,Embezzlement,Extortion,Forgery,Fraud,Harassment,Hate Crimes,Homicide,Identity Theft,Indecent Exposure,Insurance Fraud,Kidnapping,Manslaughter: Involuntary,Manslaughter: Voluntary,Medical Marijuana,MIP: A Minor in Possession,Money Laundering,Murder: First-degree,Murder: Second-degree,Open Container Law,Perjury,Probation Violation,Prostitution,Public Intoxication,Pyramid Schemes,Racketeering / RICO,Rape,Robbery,Securities Fraud,Sexual Assault,Shoplifting,Solicitation,Stalking,Statutory Rape,Tax Evasion / Fraud,Telemarketing Fraud,Theft / Larceny,Vandalism,White Collar Crimes,Wire Fraud"
},
{
"id": 3,
"on": true,
"required": true,
"type": "text",
"name": "Subject",
"data": null
},
{
"id": 4,
"on": true,
"required": true,
"type": "dropdown",
"name": "Subject Age",
"data": "Adult,Minor"
},
{
"id": 5,
"on": true,
"required": true,
"type": "dropdown",
"name": "Subject Type",
"data": "Suspect,Witness,Victim,Family,Other"
},
{
"id": 6,
"on": true,
"required": true,
"type": "text",
"name": "Interviewer 1",
"data": null
},
{
"id": 7,
"on": true,
"required": false,
"type": "text",
"name": "Interviewer 2",
"data": null
},
{
"id": 8,
"on": true,
"required": false,
"type": "note",
"name": "Notes",
"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": 401,
"message": "No API key provided"
}
}