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.
Integration first principle
Ainua Portal data integration is build upon “integration first” -principle. This means that when introducing a new page or changes to an existing page we approach it by:
- Create a new page (as needed)
- Using Ainua Portal administration
- Give the page a
page_id
- Use development mode
- Change page to development mode using Ainua Portal administration
- Do the integration
- Using a workflow tool or other integration method push first data item to
page_id
->
Available data becomes visible in Ainua Portal administration- Configure page data content visual appearance using Ainua Portal administration
- Using a workflow tool or other integration method push first data item to
- Return to normal mode
- Turn page development mode off using the Ainua Portal administration
- Page becomes available to end-users
Updating data
Request
PATCH `https://{ainua_url}/integrations/v1/items`
Header
Content-type: application/jsonAuthorization: Bearer {bearer_token}
Body
{ "{page_id}": { "{user1_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.
{ "{page_id}": { "{contentX_id}": null }, :}
Example
Request
PATCH `https://example.ainuaportal.com/integrations/v1/items`
Header
Content-type: application/jsonAuthorization: Bearer eyJhbGciOiJSUzI1Ni... ...PCBGj6DEN02WOIdzXEQ
Body
{ "USR": { "user_1000": { "content_1234": { "id": "content_1234", "userid": "user_1000", "firstname": "John", "lastname": "Customer", "jobtitle": "Sales Manager" } } }}
Response
HTTP/1.0 200 OK