In this article, get an in depth description of Idencia's open API
Overview
There is a need for external systems to provide data to the Idencia Management Portal and retrieve data from the Idencia Management Portal. By providing bi-directional data exchange, we can:
- Improve overall efficiency and productivity
- Reduce clerical work and transcription errors
- Add visibility and transparency to data
- Improve overall quality control
Scope
Data transfer via API is limited to the data associated with Items, Item Types, Jobs, and Customers.
Configuration
The Idencia Management Portal exists in a cloud environment. Interfacing systems may be on premise and/or behind a firewall, however; using the API, data exchange will not be a problem if the interfacing system uses the appropriate API key for GET, PUT and POST calls. This will also be the case if the interfacing system is a cloud hosted system.
Calls
GET
Get items modified before or after a given date/time
URL |
/api/Items |
Param Name |
Description |
modifiedAfter |
|
modifiedBefore |
|
Success Response |
|
<ArrayOfItem> - the top level of the returned list of items.
|
|
Additional Notes |
|
In addition to the Modified Date filter used in the GET call, there are two additional parameters that can be set in Azure that will affect the data returned by the API.
Item Grouping: The value of this parameter must be an Item Custom Property name. If this setting is defined, the XML tree that is returned will include an <ItemGrouping> node for each different value of the custom property defined for the Item Grouping. For example, if you have an Item Custom Property called "Inspection Date" and would like items in the XML tree to be grouped by Inspection Date, this setting can provide that grouping.
Item Filter: The value of this parameter is an expression that controls which items are returned from the API call. If this setting is not used, ALL items modified after the requested date are returned. If the setting is used, then ONLY the items where the result of the expression is True are returned. For example, you can use this filter to make sure the API only returns items that have been inspected by setting the parameter to the expression '([Inspection Date] != NULL)'.
These two parameters are set in Azure and cannot be overridden via the GET call, nor updated by the customer. These settings can only be set by Idencia staff. Please contact your customer liaison for additional information. |
|
Example Call |
|
https://<server name>.idencia.net/api/items?ModifiedAfter=<date and time>
When you make this call, you will receive an XML tree of all Items that have been modified since the date/time that you specify. This way you can make repetitive calls to the API and save the date/time that you make each call. On subsequent calls, you can specify the date/time of the previous call and only the Items that have been modified since the last call will be returned. |
POST
Create New Items
URL |
/api/Item |
Body Parameters |
|
Param Name |
Description |
Key |
API key |
number |
Serial number of item |
itemtype |
number of item type to use for this item |
properties |
list of custom property values (all properties not included in this list will be set to NULL) |
Custom Property Value |
|
name |
name of custom property |
value |
value of custom property |
Headers |
|
Key |
Value |
Content-Type |
application/json |
Response Codes |
|
200 |
OK |
400 |
this is returned if the request is bad due to various reasons including: · Item's Item Type Number does not exist in database · Item's Custom Property name does not exist in database · Item's Custom Property value does not match the Custom Property type |
401 |
Authorization key is invalid or does not exist |
Example Call |
|
{ "key": "{api-key}", "number": "1558440247", "itemtype": "test custom item type", "properties": [ { "name": "Form ID", "value": "1" } ] } |
|
Additional Notes |
|
A new item cannot be created inside of a Job. The item must first be created as a stock item. It can then be updated to have a Job and Custom Item Type with a PUT call. |
Create New Item Type
URL |
/api/ItemType |
Body Parameters |
|
Param Name |
Description |
Key |
API key |
number |
unique number of item type |
name |
Name of the new item type |
process |
the name of the Default Process to run when a new Item of this type is scanned for the first time (this can be an empty string, "", for no default Process) |
properties |
list of custom property values (all properties not included in this list will be set to NULL) |
Custom Property Value |
|
name |
name of custom property |
value |
value of custom property |
Headers |
|
Key |
Value |
Content-Type |
application/json |
Response Codes |
|
200 |
OK |
400 |
this is returned if the request is bad due to various reasons including: · Item Type's Process name does not exist in database · Item Type's Property name does not exist in database · Item Type's Property value does not match property type |
401 |
Authorization key is invalid or does not exist |
500 |
This is returned if the Item Type Number already exists in the database |
Example Call |
|
{ "key": "{api-key}", "number": "123456789", "name": "test item type", "process": "sample process name", "properties": [ { "name": "Weight", "value": "250" } ] } |
|
Additional Notes |
|
Only stock item types can be created via the API at this time. Jobs and Custom item types within a Job must be created via the Management Portal. |
PUT
Update an existing item
URL |
/api/Item |
Body Parameters |
|
Param Name |
Description |
Key |
API key |
number |
serial number of the item to be updated |
job (optional) |
job number to which the item should be assigned (must exist in the database) |
itemtype |
item type number or custom item type number (if job defined) to which the item should be assigned |
properties |
list of custom property values (properties not included in this list will be ignored, all properties included in this list with value =null or empty will be set to NULL) |
Custom Property Value |
|
name |
name of custom property |
value |
value of custom property |
Headers |
|
Key |
Value |
Content-Type |
application/json |
Response Codes |
|
200 |
OK |
401 |
If authorization key is invalid or not exists |
404 |
An item with a particular number does not exist |
409 |
Any property can not be updated |
Example Call |
|
{ "key": "{api-key}", "number": "1558440247", "job": "test job", "itemtype": "test custom item type", "properties": [ { "name": "Form ID", "value": "1" } ] } |
Update Single property of an Existing Item
Update Existing Item |
|
URL |
/api/Item/customproperty |
Body Parameters |
|
Param Name |
Description |
Key |
API key |
ItemNumber |
number of item |
CustomPropertyName |
name of custom property |
CustomPropertyValue |
value of custom property |
Headers |
|
Key |
Value |
Content-Type |
application/json |
Response Codes |
|
200 |
OK |
401 |
If authorization key is invalid or not exists |
404 |
An item with a particular number does not exist |
409 |
Any property can not be updated |
Example Call |
|
{ "key": "0", "ItemNumber": "1557923345", "CustomPropertyName":"Date Produced", "CustomPropertyValue":"34" } |