Insert

Parameters

Key

Type

REQUIRED

collection

String (Collection Name)

upload

String (Upload Name)

rows

Array of data rows

Example

The example below inserts rows to "Upload 1" in the collection "Collection 1".

curl -X POST \
  v1/data/upload\
  -H 'Authorization: Basic <Your Base64 Encoded Token>'\
  -d '{
    "collection" : "Collection 1",
    "upload"     : "Upload 1",
    "rows"       : [
        ["0001","2020-11-30",1,50],
        ["0002","2020-11-30",2,70]
    ]
}'

Success Response

The response returns current information on the collection. The stats property will detail how many uploads are in the collection, rows inserted, and what size the sum of the data is.

{
    "status": "success",
    "data": {
        "collection": "My Collection",
        "upload": "Upload 1",
        "warnings": 0,
        "messages": [],
        "stats": {
            "uploads": 1,
            "size": 476,
            "inserts": 2
        }
    },
    "hash": "087c91c99b93c46e8b286e83cce61c70",
    "response_time": 0.6148860454559326
}

Success Response With Warnings

If there are any issues with the row parameters, the response will contain a number of warnings along with an array of messages detailing the warnings.

{
    "status": "success",
    "data": {
        "collection": "My Collection",
        "upload": "Upload 1",
        "warnings": 1,
        "messages": [
            {
                "parameter": "rows",
                "index": 2,
                "error": "Row did not have a valid data paramater."
            }
        ],
        "stats": {
            "uploads": 1,
            "size": 694,
            "inserts": 2
        }
    },
    "hash": "66837665b6128ea5c6c230d0469836fb",
    "response_time": 0.5959510803222656
}

Last updated