Pepperi API Design
Search…
Generic Resource
PEPPERI NOTIFICATION SERVICE
Actions Queue
CPI Node
TODO training
Powered By GitBook
Data Import
Import data to ADAL
post
https://api.pepperi.com
/v1.0/addons/data/import/{addonUUID}/{table}
Data import
Given an array of objects, pre-processes them using relations to prepare them for upload, and uploads them in batches using BulkPut.
    Maximum input is 6MB
    A single object cannot exceed 400KB
    Maximum of 500 objects in input
An object is uploaded to the database using a "put" request, rather than an "update" request. This means that when uploading an object, if an object with the same key already exists in the database, it is overwritten by the new object.
Using this interface is only possible with tables that support Import/Export. In order to support Import/Export, please refer to the Import and export relations.

Overwrite

When uploading an object to the database using a "put" action, it will overwrite an existing object with the same key. Because of this, before uploading the object this function first checks if the object already exists in the database, and if so merges them together (overwriting only modified attributes) and only then uploads them.
This happens by default. If an addon wishes to import objects while completely overwriting any existing object in the database (i.e. bypass the merging process) it may also pass "Overwrite"=true in the body parameter.
If "Overwrite" = true, all successful uploads will be represented in the ImportedObject returned as the Status: "Insert".

Input:

1
{
2
'Objects':
3
[
4
{
5
'Key': 'foo',
6
'Attribute1': 'something',
7
'Attribute2': 'something else'
8
},
9
{
10
//...
11
}
12
],
13
'Overwrite': false // false by default.
14
15
}
Copied!

Output:

Outputs an object containing an array of ImportedObjects, each matching by index an input object (i.e. output.Objects[5] is an ImportedObject corresponding to the input object input.Objects[5].
Automatically fills in values for the 'Key' attribute of the output ImportedObjects, using the 'Key' values in the objects returned by the relation. If no such value exists, the output ImportedObject will contain an empty 'Key' and the 'Status' will be 'Error' ("Key is missing").
An output ImportedObject's 'Object' attribute will always be empty.
Last modified 10d ago
Copy link