Instance Bulk API (1.0)

http://localhost

Table of contents

Instance Storage Bulk API

API to update existing instances or create if they do not exist

Update or create a collection of instances

POST /instance-storage/instances/bulk

Update or create a list of instances

POST /instance-storage/instances/bulk
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Bulk entities upsert request",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "recordsFileName": {
      "description": "File name of entities records",
      "type": "string"
    },
    "publishEvents": {
      "description": "A flag that indicates whether domain events should be published.",
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "recordsFileName"
  ]
}

Response 201

At least one Instance from the list was updated/created

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Bulk entities upsert response",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "errorRecordsFileName": {
      "description": "File name of failed entities",
      "type": "string"
    },
    "errorsFileName": {
      "description": "File name of error details",
      "type": "string"
    },
    "errorsNumber": {
      "description": "Total number of errors",
      "type": "integer",
      "default": 0
    }
  },
  "required": [
    "errorRecordsFileName",
    "errorsFileName",
    "errorsNumber"
  ]
}

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error