Question JSON


Overview

The question portion of the request is an array. Each numerical index in the array corresponds to an index in the content array. For instance, index 1 of the question array will be displayed along side the content data present at index 1 of the content array.

Step

Form elements are grouped into Steps. When displaying questions alongside content, the Step also determines what content is shown.

Width

A number 1 through 12 that corresponds to the width of the question container. Atom task uses a bootstrap grid system, meaning that 1 is roughly a width of 8.3% and 12 is 100%.

Offset

A number 1 through 12 that corresponds to the offset of the question container from the left. Atom task uses a bootstrap grid system, meaning that 1 is roughly an offset of 8.3% and 6 is 50%.

Body

The Body is an array of individual form elements associated with a paticular step. An element contained within the body portion will have the following attributes.

parent
  The parent of the element at this index. To embed multiple elements in the same parent element, use the same parent index.

width
  A number 1 through 12 that corresponds to the width of the element. Atom task uses a bootstrap grid system, meaning that 1 is roughly a width of 8.3% and 12 is 100%.

offset
  A number 1 through 12 that corresponds to the offset of the element from the left. Atom task uses a bootstrap grid system, meaning that 1 is roughly an offset of 8.3% and 6 is 50%.

label
  A descriptor for the form element.

element_id
  A unique ID for the form element. This should be an incrementing intiger starting at 0.

type
  There are 9 different element types. They are as follows: SELECT, INPUT, TEXTAREA, CHECKBOXGROUP, RADIOGROUP, DATE, TIME, DATETIME, CHECKBOX.

subType
  subType is only used for the SELECT, CHECKBOXGROUP, and RADIOGROUP elements. The value should be set to either 0 or 1. If 0 the data for the element will be loaded locally from subType_data. If set to 1, Atom Task will request a remote JSON object considing of key/value pairs from a url you provide via subTypeUrl.

subType_data
  If subType is set to 0 subType_data should be present, consisting of an object listing key/value pairs to populate the element.

subTypeUrl
  If subType is set to 1 subTypeUrl should be set to a URL pointing to a JSON object of key/value pairs to populate the element. Please remember that CORS headers should be set to '*', and that content must be served over HTTPS.

Example Open Task Request




{
  "USERID": "YOUR_USERID_HERE",
  "KEY": "YOUR_API_KEY_HERE",
  "WebHook": "https://www.yourwebsite.com/processWebHook/something.php?id=whaterurlencodeddatayouwant",
  "CustomID": "YOUR_CUSTOMID_HERE",
  "Budget": "100",
  "Title": "Example Request",
  "Description": "This is an example task request.",
  "EstimatedDuration": 600,
  "ExpiresAfter": 86400,
  "Keywords": [
    "Keyword1",
    "Keyword2"
  ], 
  "AutoApproveAfter": 86400,
  "Instructions": "This is where you say what needs to be done.",
 "Content": {
      "0":{
        "Width": 8,
        "Type": "pdf",
        "Options": {
          "url": ""
        }
      },
      "1":{
        "Width": 8,
        "Type": "text",
        "Options": {
          "value": "Go to google and search for the 'Country Villas Homeowners Association' and enter the url."
        }
      }
 },
  "Questions": {
    "0": {
      "Width": 4,
      "Body": [
        {
          "parent": 0,
          "label": "What type of dwelling is listed on the document?",
          "type": "SELECT",
          "width": "12",
		  "offset": "0",
          "element_id": 0,
          "step": 0,
          "subType": 0,
          "subType_data": {
            "Single Family Home": "0",
            "Town Home": "1",
            "Condo": "2"
          }
        },
        {
          "parent": "1",
          "label": "",
          "type": "SELECT",
          "width": "12",
		  "offset": "0",
          "element_id": 1,
          "step": 1,
          "subType": "0",
          "subType_data": {
            "a": "1",
            "b": "2",
            "c": "3"
          }
        }
      ]
    },
    "1": {
      "Width": 4,
      "Body": [
        {
          "parent": "2",
          "label": "Could You Located The Homeowner Association URL?",
          "type": "SELECT",
          "width": "12",
		  "offset": "0",
          "element_id": 2,
          "step": 0,
          "subType": 0,
          "subType_data": {
            "No": "0",
            "Yes": "1"
          }
        }
      ]
    }
  }
}