-
Notifications
You must be signed in to change notification settings - Fork 3
Calls API
The Calls API provides access to TeamHaven's Call Management functionality. To access the answers from completed calls, use the Answers API.
GET /api/calls/:id[?schema=true]
Retrieves the Call with the specified Call ID. If schema=true, then the Call's Attribute Schema is included in the response.
POST /api/projects/:pid/targets/:tid/calls
Creates a new Call in the Project specified by :pid visiting the Target specified by :tid. TeamHaven supports two types of Call, normal and Fixed Appointments. Both types of Call can be created by varying the request's JSON payload.
To create a normal Call:
{
EarliestDate: "2015-12-13T00:00:00", // Times have no meaning for EarliestDate or
LatestDate: "2015-12-19T00:00:00" // LatestDate and will be ignored
}To create a Fixed Appointment:
{
FixedAppointment: true,
PlannedStart: "2015-12-13T15:00:00"
}If the Project has a Call Schema, then a set of Call Attributes can be included:
{
EarliestDate: "2015-12-13T00:00:00", // Times have no meaning for EarliestDate or
LatestDate: "2015-12-19T00:00:00", // LatestDate and will be ignored
Attributes: {
AttributeName1: "Attribute Value 1",
AttributeName2: "Attribute Value 2"
}
}GET /api/calls/:id/questionnaire
Retrieves the Call's questionnaire. This questionnaire will be customised for the call - any items known not to be present will not appear.
{
"QuestionnaireID": 1,
"Caption": "Test questionnaire",
"Forms": [
{
"FormID": 1,
"Caption": "Survey form",
"Questions": [
{
"QuestionID": 1,
"Caption": "ID",
"Type": 7,
"Required": false,
"ReadOnly": false
},
{
"QuestionID": 2,
"Caption": "Numeric",
"Type": 2,
"Required": false,
"ReadOnly": false,
"DecimalPlaces": 0
},
{
"QuestionID": 3,
"Caption": "Small text",
"Type": 1,
"Required": false,
"ReadOnly": false,
"Rows": 1,
"Columns": 30
},
{
"QuestionID": 4,
"Caption": "Big text",
"Type": 1,
"Required": false,
"ReadOnly": false,
"Rows": 1,
"Columns": 30
},
{
"QuestionID": 5,
"Caption": "Single choice",
"Type": 3,
"Required": false,
"ReadOnly": false,
"Choices": [
{
"ChoiceID": 1,
"Caption": "Option 1"
},
{
"ChoiceID": 2,
"Caption": "Option 2"
},
{
"ChoiceID": 3,
"Caption": "Option 3"
}
]
},
{
"QuestionID": 6,
"Caption": "Multiple choice",
"Type": 4,
"Required": false,
"ReadOnly": false,
"Choices": [
{
"ChoiceID": 4,
"Caption": "Option A"
},
{
"ChoiceID": 5,
"Caption": "Option B"
},
{
"ChoiceID": 6,
"Caption": "Option C"
}
]
},
{
"QuestionID": 7,
"Caption": "Yes/No",
"Type": 6,
"Required": false,
"ReadOnly": false
},
{
"QuestionID": 8,
"Caption": "Picture",
"Type": 10,
"Required": false,
"ReadOnly": false,
"Resolution": 640
},
{
"QuestionID": 9,
"Caption": "Signature",
"Type": 11,
"Required": false,
"ReadOnly": false
},
{
"QuestionID": 10,
"Caption": "Time",
"Type": 9,
"Required": false,
"ReadOnly": false
}
],
"Type": 1
},
{
"FormID": 2,
"Caption": "Grid form",
"Questions": [
{
"QuestionID": 11,
"Caption": "Grid numeric",
"Type": 2,
"Required": false,
"ReadOnly": false,
"DecimalPlaces": 0
},
{
"QuestionID": 12,
"Caption": "Small text",
"Type": 1,
"Required": false,
"ReadOnly": false,
"Rows": 1,
"Columns": 30
},
{
"QuestionID": 13,
"Caption": "Big text",
"Type": 1,
"Required": false,
"ReadOnly": false,
"Rows": 5,
"Columns": 40
},
{
"QuestionID": 14,
"Caption": "Grid single choice",
"Type": 3,
"Required": false,
"ReadOnly": false,
"Choices": [
{
"ChoiceID": 7,
"Caption": "Option 1"
},
{
"ChoiceID": 8,
"Caption": "Option 2"
},
{
"ChoiceID": 9,
"Caption": "Option 3"
}
]
},
{
"QuestionID": 15,
"Caption": "Grid multiple choice",
"Type": 4,
"Required": false,
"ReadOnly": false,
"Choices": [
{
"ChoiceID": 10,
"Caption": "Option A"
},
{
"ChoiceID": 11,
"Caption": "Option B"
},
{
"ChoiceID": 12,
"Caption": "Option C"
}
]
},
{
"QuestionID": 16,
"Caption": "Grid yes/no",
"Type": 6,
"Required": false,
"ReadOnly": false
},
{
"QuestionID": 17,
"Caption": "Grid picture",
"Type": 10,
"Required": false,
"ReadOnly": false,
"Resolution": 640
},
{
"QuestionID": 18,
"Caption": "Grid signature",
"Type": 11,
"Required": false,
"ReadOnly": false
}
],
"Items": [
{
"ItemID": 1,
"Caption": "Item 1",
"Attributes": {
"Manufacturer": "Manufacturer A"
}
},
{
"ItemID": 2,
"Caption": "Item 2",
"Attributes": {
"Manufacturer": "Manufacturer B"
}
},
{
"ItemID": 3,
"Caption": "Item 3",
"Attributes": {
"Manufacturer": "Manufacturer C"
}
},
{
"ItemID": 4,
"Caption": "Item 4",
"Attributes": {
"Manufacturer": "Manufacturer A"
}
},
{
"ItemID": 5,
"Caption": "Item 5",
"Attributes": {
"Manufacturer": "Manufacturer B"
}
},
{
"ItemID": 6,
"Caption": "Item 6",
"Attributes": {
"Manufacturer": "Manufacturer C"
}
}
],
"Type": 2
}
]
}GET /api/calls/:id/questionnaire/manifest
Retrieves the Call's questionnaire in manifest format. This format does not contain any layout information and instead just presents a list of all the Questions and Items.
This format is more suitable for applications wishing to extract information from a completed Call, whereas the other format is more appropriate for applications wishing to construct a visual representation of the Call's Questionnaire.
{
"QuestionnaireID": 1,
"Questions": [
{
"QuestionID": 1,
"Caption": "ID",
"Type": 7,
"Required": false,
"ReadOnly": false
},
{
"QuestionID": 2,
"Caption": "Numeric",
"Type": 2,
"Required": false,
"ReadOnly": false,
"DecimalPlaces": 0
},
{
"QuestionID": 3,
"Caption": "Small text",
"Type": 1,
"Required": false,
"ReadOnly": false,
"Rows": 1,
"Columns": 30
},
{
"QuestionID": 4,
"Caption": "Big text",
"Type": 1,
"Required": false,
"ReadOnly": false,
"Rows": 1,
"Columns": 30
},
{
"QuestionID": 5,
"Caption": "Single choice",
"Type": 3,
"Required": false,
"ReadOnly": false,
"Choices": [
{
"ChoiceID": 1,
"Caption": "Option 1"
},
{
"ChoiceID": 2,
"Caption": "Option 2"
},
{
"ChoiceID": 3,
"Caption": "Option 3"
}
]
},
{
"QuestionID": 6,
"Caption": "Multiple choice",
"Type": 4,
"Required": false,
"ReadOnly": false,
"Choices": [
{
"ChoiceID": 4,
"Caption": "Option A"
},
{
"ChoiceID": 5,
"Caption": "Option B"
},
{
"ChoiceID": 6,
"Caption": "Option C"
}
]
},
{
"QuestionID": 7,
"Caption": "Yes/No",
"Type": 6,
"Required": false,
"ReadOnly": false
},
{
"QuestionID": 8,
"Caption": "Picture",
"Type": 10,
"Required": false,
"ReadOnly": false,
"Resolution": 640
},
{
"QuestionID": 9,
"Caption": "Signature",
"Type": 11,
"Required": false,
"ReadOnly": false
},
{
"QuestionID": 10,
"Caption": "Time",
"Type": 9,
"Required": false,
"ReadOnly": false
},
{
"QuestionID": 11,
"Caption": "Grid numeric",
"Type": 2,
"Required": false,
"ReadOnly": false,
"DecimalPlaces": 0
},
{
"QuestionID": 12,
"Caption": "Small text",
"Type": 1,
"Required": false,
"ReadOnly": false,
"Rows": 1,
"Columns": 30
},
{
"QuestionID": 13,
"Caption": "Big text",
"Type": 1,
"Required": false,
"ReadOnly": false,
"Rows": 5,
"Columns": 40
},
{
"QuestionID": 14,
"Caption": "Grid single choice",
"Type": 3,
"Required": false,
"ReadOnly": false,
"Choices": [
{
"ChoiceID": 7,
"Caption": "Option 1"
},
{
"ChoiceID": 8,
"Caption": "Option 2"
},
{
"ChoiceID": 9,
"Caption": "Option 3"
}
]
},
{
"QuestionID": 15,
"Caption": "Grid multiple choice",
"Type": 4,
"Required": false,
"ReadOnly": false,
"Choices": [
{
"ChoiceID": 10,
"Caption": "Option A"
},
{
"ChoiceID": 11,
"Caption": "Option B"
},
{
"ChoiceID": 12,
"Caption": "Option C"
}
]
},
{
"QuestionID": 16,
"Caption": "Grid yes/no",
"Type": 6,
"Required": false,
"ReadOnly": false
},
{
"QuestionID": 17,
"Caption": "Grid picture",
"Type": 10,
"Required": false,
"ReadOnly": false,
"Resolution": 640
},
{
"QuestionID": 18,
"Caption": "Grid signature",
"Type": 11,
"Required": false,
"ReadOnly": false
}
],
"Items": [
{
"ItemID": 1,
"Caption": "Item 1",
"Attributes": {
"Manufacturer": "Manufacturer A"
}
},
{
"ItemID": 2,
"Caption": "Item 2",
"Attributes": {
"Manufacturer": "Manufacturer B"
}
},
{
"ItemID": 3,
"Caption": "Item 3",
"Attributes": {
"Manufacturer": "Manufacturer C"
}
},
{
"ItemID": 4,
"Caption": "Item 4",
"Attributes": {
"Manufacturer": "Manufacturer A"
}
},
{
"ItemID": 5,
"Caption": "Item 5",
"Attributes": {
"Manufacturer": "Manufacturer B"
}
},
{
"ItemID": 6,
"Caption": "Item 6",
"Attributes": {
"Manufacturer": "Manufacturer C"
}
}
]
}Note: This API will be replaced by GET /api/calls/:id/questionnaire using a custom media type in a future version of the API.