Difference between revisions of "Create Custom List Item"
From MyMobileWorkers API
| Line 46: | Line 46: | ||
! Response | ! Response | ||
| colspan="2" | JSON | | colspan="2" | JSON | ||
| + | |} | ||
| + | |||
| + | == JSON Contents == | ||
| + | |||
| + | {| border="1" class="wikitable" | ||
| + | |+ The JSON file is passed in the post as the "file" | ||
| + | ! colspan="3" | Standard Fields | ||
| + | |- | ||
| + | ! Field | ||
| + | ! Expected Data | ||
| + | ! Required | ||
| + | |- | ||
| + | ! list_key | ||
| + | | float(10,2) || ✓ | ||
| + | |- | ||
| + | ! name | ||
| + | | float(10,2) || ✓ | ||
| + | |- | ||
| + | ! notes | ||
| + | | text || | ||
| + | |- | ||
| + | ! order_position | ||
| + | | text || | ||
| + | |- | ||
| + | ! external_id | ||
| + | | varchar(45) || | ||
| + | |- | ||
| + | |} | ||
| + | |||
| + | {| border="1" class="wikitable" | ||
| + | |+ Fields exclusive to JSON body format: | ||
| + | ! colspan="3" | Standard Fields | ||
| + | |- | ||
| + | ! Field | ||
| + | ! Expected Data | ||
| + | ! Required | ||
| + | |- | ||
| + | ! key | ||
| + | | string - company api key || ✓ | ||
| + | |- | ||
| + | ! update_existing | ||
| + | | boolean || | ||
| + | |- | ||
|} | |} | ||
Revision as of 10:24, 28 July 2017
Contents |
Summary
A list item can be created via two different methods - either as multi-part form data with a JSON file attached and the API key as a parameter, or as JSON content on it's own, with the API key supplied within the JSON.
The 'create item' method accepts an array of list items to be added to the system. If the 'update_existing' parameter is set, then any existing list items will be updated in the system. If set to false or not provided..
Multi Part Form Data
| Create Item | ||
|---|---|---|
| URL | http://base_url/api_path/version/list/item/create | |
| Type | POST | |
| Params: | api_key | required |
| file | required | |
| update_existing | optional (default = false) | |
| Response | JSON | |
JSON As Body
| Create Item - JSON | ||
|---|---|---|
| URL | https://base_url/api_path/version/list/item/create | |
| Type | POST | |
| JSON {key, update_existing(optional), items[]} |
required | |
| Response | JSON | |
JSON Contents
| Standard Fields | ||
|---|---|---|
| Field | Expected Data | Required |
| list_key | float(10,2) | ✓ |
| name | float(10,2) | ✓ |
| notes | text | |
| order_position | text | |
| external_id | varchar(45) | |
| Standard Fields | ||
|---|---|---|
| Field | Expected Data | Required |
| key | string - company api key | ✓ |
| update_existing | boolean | |