diff --git a/docs/api/Items.md b/docs/api/Items.md index 9d14e8f..e284ebd 100644 --- a/docs/api/Items.md +++ b/docs/api/Items.md @@ -4,7 +4,7 @@ An item is a chronological representation of an interaction with a user. ## Endpoint ``` -GET /api/{queue}/{number} +GET /api/data/{queue}/{number} ``` ### Parameters Name | Value @@ -15,40 +15,40 @@ Name | Value ### Query String Options Name | Description | Possible Values - | - | - -`headersOnly` | When `"True"`, only meta data will be loaded. When `"False"` content will be parsed. (Defaults to `"False"`.) | `"True"` \| `"False"` +`headers_only` | When `"True"`, only meta data will be loaded. When `"False"` content will be parsed. (Defaults to `"False"`.) | `"True"` \| `"False"` ### Return Codes Code | Description - | - `200 - Ok` | On success. +`404 - Not Found` | When the Item does not exist. `500 - Internal Service Error` | On failure. ## Properties -### `Item.lastUpdated` +### `Item.assigned_to`: Type | Description - | - -`String` | An ISO 8601 formatted time string showing the last time the file was updated according to the filesystem. +`String` | The Purdue career account alias of the person this item is assigned to. !!! example ```js - console.log(Item.lastUpdated) - // Expected Output - "2021-04-03T00:48:38+00:00" + console.log(Item.assigned_to) + // Expexted Output + "sundeep" ``` - -### `Item.headers` +### `Item.building` Type | Description - | - -`Array` | An array of objects containing parsed item headers in `type`/`value` pairs. +`String` | The building a particular Item is related to. !!! example ```js - console.log(Item.headers[0]) + console.log(Item.building) // Expexted Output - { type: "From", content: "\"Campbell, Justin Tyler\" \n"} + "ME" ``` ### `Item.content` @@ -322,76 +322,112 @@ Type | Description } ``` -### `Item.isLocked` +### `Item.date_received` Type | Description - | - -`Boolean` | A boolean showing whether or not a lockfile for the item is present. +`String` | An ISO 8601 formatted time string showing the date this item was created. !!! example ```js - console.log(Item.isLocked) + console.log(Item.date_received) // Expexted Output - true + "2021-04-03T00:48:38+00:00" ``` -### `Item.userEmail` +### `Item.department` Type | Description - | - -`String` | The email address of the person who this item is from. +`String` | The most recent department for this item. !!! example ```js - console.log(Item.userEmail) + console.log(Item.department) // Expexted Output - "campb303@purdue.edu" + "Bussiness Office" ``` -### `Item.userName` +### `Item.headers` Type | Description - | - -`String` | The real name of the person who this item is from. +`Array` | An array of objects containing parsed item headers in `type`/`value` pairs. !!! example ```js - console.log(Item.userName) + console.log(Item.headers[0]) // Expexted Output - "Justin Campbell" + { type: "From", content: "\"Campbell, Justin Tyler\" \n"} ``` -### `Item.userAlias`: +### `Item.is_locked` Type | Description - | - -`String` | The Purdue career account alias of the person this item is from. +`Boolean` | A boolean showing whether or not a lockfile for the item is present. !!! example ```js - console.log(Item.userAlias) + console.log(Item.is_locked) // Expexted Output - "campb303" + true ``` -### `Item.assignedTo`: +### `Item.last_updated` Type | Description - | - -`String` | The Purdue career account alias of the person this item is assigned to. +`String` | An ISO 8601 formatted time string showing the last time the file was updated according to the filesystem. + +!!! example + ```js + console.log(Item.last_updated) + // Expected Output + "2021-04-03T00:48:38+00:00" + ``` + +### `Item.number` +Type | Description +- | - +`Number` | The indentifying number of the queue item. !!! example ```js - console.log(Item.assignedTo) + console.log(Item.number) + // Expected Output + 4 + ``` + +### `Item.path` +Type | Description +- | - +`String` | The absolute file path to the Item. + +!!! example + ```js + console.log(Item.path) + // Expected Output + "/home/pier/e/queue/Mail/ce/1" + ``` + +### `Item.priority:` +Type | Description +- | - +`String` | The most recent priority for this item. + +!!! example + ```js + console.log(Item.priority) // Expexted Output - "sundeep" + "COVID" ``` -### `Item.subject:` +### `Item.queue:` Type | Description - | - -`String` | The subject of the original message for this item. +`String` | The queue the Item is in. !!! example ```js - console.log(Item.subject) + console.log(Item.queue) // Expexted Output - "Can't Access Outlook" + "ce" ``` ### `Item.status` @@ -406,38 +442,50 @@ Type | Description "Waiting for Reply" ``` -### `Item.priority:` +### `Item.subject:` Type | Description - | - -`String` | The most recent priority for this item. +`String` | The subject of the original message for this item. !!! example ```js - console.log(Item.priority) + console.log(Item.subject) // Expexted Output - "COVID" + "Can't Access Outlook" ``` -### `Item.department` +### `Item.user_alias`: Type | Description - | - -`String` | The most recent department for this item. +`String` | The Purdue career account alias of the person this item is from. !!! example ```js - console.log(Item.department) + console.log(Item.user_alias) // Expexted Output - "Bussiness Office" + "campb303" ``` -### `Item.dateReceived` +### `Item.user_email` Type | Description - | - -`String` | An ISO 8601 formatted time string showing the date this item was created. +`String` | The email address of the person who this item is from. !!! example ```js - console.log(Item.dateReceived) + console.log(Item.user_email) // Expexted Output - "2021-04-03T00:48:38+00:00" + "campb303@purdue.edu" + ``` + +### `Item.user_name` +Type | Description +- | - +`String` | The real name of the person who this item is from. + +!!! example + ```js + console.log(Item.user_name) + // Expexted Output + "Justin Campbell" ``` \ No newline at end of file