Items API
Ainua Portal Items API provides RESTful access for data integration. It is designed for integrating data from a back-office solution to Ainua Portal.
For added security Items API is write-only as are all Ainua Portal API’s.
Items can be synchoronized to either as targeted to a certain Account or non-targeted in which case they are available for all Accounts/Users. Typically targeted data includes company specific information like its contact details, offers, direct messages with the company etc. Non-targeted is typically used for example for product catalog, events and other similar publicly available information. Non-targeted data can of course be also targeted by using Account or User profile data in conjuction with information in data Items.
Updating data
Request
PATCH `https://{ainua_url}/api/integrations/v1/items`
Header
Content-type: application/jsonAuthorization: Bearer {bearer_token}
Body
{ "{data_id}": { "{account1_id}": { "{content1_id}": { "{data_1_key}": "{data_1_value}", "{data_2_key}": "{data_2_value}", "{data_3_key}": "{data_3_value}", "{data_4_key}": "{data_4_value}", "{data_5_key}": "{data_5_value}", "{data_6_key}": "{data_6_value}", : }, "{content2_id}": { : } }, : }, :}
Request will return 200 OK
on success.
To remove a user provide null
as user data.
{ "{data_id}": { "{account1_id}": { "{contentX_id}": null } }, :}
Example
Request
PATCH `https://example.ainuaportal.com/api/integrations/v1/items`
Header
Content-type: application/jsonAuthorization: Bearer eyJhbGciOiJSUzI1Ni... ...PCBGj6DEN02WOIdzXEQ
Body
{ "USR": { "account_001": { "content_1234": { "id": "content_1234", "userid": "user_1000", "firstname": "John", "lastname": "Customer", "jobtitle": "Sales Manager" } } }}
Response
HTTP/1.0 200 OK