Skip to content
Richard Thombs edited this page Nov 13, 2015 · 33 revisions

The Calls API provides access to TeamHaven's Call Management functionality. To access the answers from completed calls, use the Answers API.

  1. Get a Call
  2. Get a Call's Questionnaire
  3. Get a Call's Questionnaire Manifest

Get Call

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.

Get Call's Questionnaire

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.

Response

{
  "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 Call's Questionnaire Mannifest

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.

Clone this wiki locally