generic

CREATE: Inserts a new document into the collection

Using this operation you can insert new documents into collection. Normally the operation ends with 201 HTTP status code, Last-Modified and Location headers specified and with an empty response content. identifier can be parsed from the Location response header.

When the document to post is marked as a duplicate (using rules described at API3_DEDUP_FALLBACK_ENABLED switch), the update operation takes place instead of inserting. In this case the original document in the collection is found and it gets updated by the actual operation POST body. Finally the operation ends with 204 HTTP status code along with Last-Modified and correct Location headers.

This operation provides autopruning of the collection (if autopruning is enabled).

This operation requires create (and/or update for deduplication) permission for the API and the collection (e.g. api:treatments:create and api:treatments:update)

post/{collection}

Request body

OR
OR
OR
OR
OR

Example request

{
  "identifier": "53409478-105f-11e9-ab14-d663bd873d93",
  "date": 1525383610088,
  "utcOffset": 120,
  "app": "xdrip",
  "device": "dexcom G5",
  "_id": "58e9dfbc166d88cc18683aac",
  "srvCreated": 1525383610088,
  "subject": "uploader",
  "srvModified": 1525383610088,
  "modifiedBy": "admin",
  "isReadOnly": true
}

Response

Successfully created a new document in collection

Changes