Yoobic Inventory API
An Inventory is a custom data structure to manage and use data in a similar way as in a spreadsheet or database directly from the YOOBIC Platform. Each inventory has a defined structure that rely on the same fields as in a YOOBIC campaign. ### Fields | Field | Type | Required | Readonly | OrderBy | Description | |----------------------|:--------------:|:--------:|:--------:|:-------:|---------------------------| |`inventory_id` | string | x | x | | Unique id of the inventory | |`description` | string | | x | | The inventory description | |`name` | string | | x | | The inventory name | |`title` | string | | x | | The inventory title | |`group_ids` | array | | x | | Group ids that can see this inventory | |`page_titles` | array | | x | | An ordered list of page titles i.e. first title is the first page title etc. | |`questions` | array | | x | | The inventory's questions | |`created_date` | date | | x | | Creation date | |`updated_date` | date | | x | x | Last update date | The `questions` field is defined as an array of: | Field | Type | Description | |----------------------|----------------|---------------------------| |`question_id` | string | Unique id of the question | |`question_type` | string | The type of the question. Supported types: `text`, `textarea`, `toggle`, `checkbox`, `information`, `todo`, `photo`, `multiphotos`, `selectbuttons`, `select`, `selectmulti`, `address`, `date`, `number`, `starrating`, `image`. | |`question` | string | The title of the question | |`question_description`| string | The description of the question | |`mandatory` | boolean | If `true`, the question has to be answered. Defaults to `false` | |`page_number` | number | The number of the page the question appears in | |`question_number` | number | The number of the question | |`hide_mobile` | boolean | Hide the question on mobile devices. Defaults to `false`. | |`question_attributes` | object | Question attributes for specific question types.| The `question_attributes` field is defined as an object with the following fields: | Field | Type | Description | |----------------------|----------------|---------------------------| |`max_photos` | number | Maximum of allowed photos to upload. Applies only to questions of type `multiphotos`. | |`values` | array | Values to be displayed as options to choose from in the question. Applies only to questions of type `selectbuttons`, `select`, `selectmulti`. | |`min` | number | If present, value must be above or including it. Applies only to questions of type `number`. | |`max` | number | If present, value must be below or including it. Applies only to questions of type `number`, `starrating`. | #### Question Types **Important** Below is a list of the supported types and their value types: | question_type | Type | Description | |---------------|:--------------:|-------------| | address | string | | | date | string | | | information | string | | | select | string | Single value chosen from the `values` defined in `question_attributes` | | textarea | string | | | text | string | | | photo | URL | A valid image URL | | multiphotos | array of URLs | Valid image URLs and up to `max_photos` defined in `question_attributes` | | selectbuttons | array | Multiple values chosen from the `values` defined in `question_attributes` | | selectmulti | array | Multiple values chosen from the `values` defined in `question_attributes` | | number | number | Might have min, max borders as defined in `question_attributes` | | starrating | number | Might have max border as defined in `question_attributes`. No negatives allowed. | | checkbox | boolean | | | toggle | boolean | | | image | | This is a readonly property (informative) which does not have a value. | **Important** - If `page_titles` does not have a title for a given page then a default will be given - So i.e. if the values are - ```json [ "first chapter", "second chapter" ] ``` and there are three pages in total, then the title for the third page will be `Page 3`. - To filter on `live` campaigns only you should filter accordingly: ```json { "active": true, "archived": { "neq": true } } ```