Post

Insert, Update & Delete one or more rows into the database

/v1/api

POST https://next.cloudio.io/v1/api

This endpoint allows you to perform insert, update & delete operations against one or more data sources

Query Parameters

Name
Type
Description

csrf

string

Auth response csrf value

Headers

Name
Type
Description

Authentication

string

Authentication token JS e.g. `Bearer ${authResponse.jwt}`

Request Body

Name
Type
Description

JSON Payload

string

See below for the structure/type of the body payload

{
  "status": "OK",
  "data": {
    "EmployeesAlias": {
      "data": [
        {
          "active": "Y",
          "createdBy": "userName",
          "creationDate": "2021-05-30T04:19:41.483732Z",
          "empId": 1004,
          "gender": "X",
          "lastUpdateDate": "2021-05-30T04:19:41.483732Z",
          "lastUpdatedBy": "userName",
          "name": "name value",
          "salary": 1,
          "_rs": "Q"
        }
      ],
    }
  }
}

Sample Payloads

{
    "EmployeesAlias": {
        "ds": "Employees",
        "data": [
            {
                "_rs": "I",
                "active": "Y",
                "gender": "X",
                "name": "name value",
                "salary": 1
            }
        ]
    }
}
{
  "EmployeesAlias": {
    "ds": "Employees",
    "data": [
      { "_rs": "I", "name": "Steve" },
      { "_rs": "U", "empId": 999, ..., "lastUpdateDate": "2020-11-30T23:59:59.999Z" },
      { "_rs": "D", "empId": 123, ..., "lastUpdateDate": "2020-11-30T23:59:59.999Z" },
    ]
  }
}

Record Status `_rs`

Every row must include a record status _rs. A value of I U & D indicates that the row must be inserted, updated & deleted respectively. Rows with U and D must accompany with all the primary key attributes & WHO columns, especially lastUpdateDate attribute.

Response: Record Status & WHO Columns

After successful post, all the records that are part of the request will be returned back with a records status of Q indicating Query status. Also, all the WHO columns (createdBy, creationDate, lastUpdatedBy & lastUpdateDate) will be populated with the current authenticated userName & server datetime values. Also the values may have changed by any pre and post insert/update scripts.

Note: The order of the rows in the response is not guaranteed to be in the same order as the request.

Note: Any value passed for a non-updatable attribute will be ignored. The whole request will be rejected if any of attribute passed is not defined.

Last updated