Developer Docs
OverviewGroupsPathways
  • Getting Started
  • Overview
    • API Manager
    • User Privacy
    • Responses
  • Groups
    • Concepts
    • Manage
    • Status
    • Insert
    • Remove
  • Data
    • Overview
    • List
    • Upload
    • Download
    • Delete
    • Insert
    • Remove
  • Pathways
    • Overview
    • Enrolments
      • List
      • Manage
    • Web Tracking
      • Serverless
      • Server-Side Platforms
    • Classroom & Events
      • List
      • Consume
    • Rewards
      • List
      • Consume
    • Webhooks
      • Enrolments
      • Classroom & Events
      • Rewards
    • Logs
      • Activity & Fulfilment Types
      • Activity & User Logs
  • Stories
    • Logs
      • Story Logs
      • User Story Logs
    • Certificates
    • Question Analysis
  • Streams
    • Subscriptions
    • Ratings
  • Analytics
    • Overview
    • Published
    • Realtime
    • Audience
      • Frequency
      • Demographics
      • Locations
      • Retention
    • Reviews
Powered by GitBook
On this page
  • Parameters
  • Example
  • Success Response
  • Success Response With Warnings
  1. Data

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/insert\
  -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
}
PreviousDeleteNextRemove

Last updated 5 months ago