Objectivity REST : Transaction Resources : POST /v1/transaction
POST /v1/transaction
POST /v1/transaction
Sends multiple requests for batch processing.
Headers 
 
Response Format
Accept:application/json
Body format
Content-Type:application/json
URL Parameters 
fdAlias
Provides the alias of a federated database that is included in the REST server’s configuration file; see Configuring the REST Server in Objectivity/DB Administration.
Body Parameters 
method
(Required) Specifies the HTTP method for the operation.
uri
(Required) Specifies the resource to use.
body
(Optional) Provides the request body where applicable.
result
(Optional) Specifies how the results of the operation are handled.
For an operation that creates, modifies, or deletes objects or schema, the keep option makes the changes permanent whereas dispose does not. For a query operation, keep shows results whereas dispose omits them.
Discussion 
You can use this resource to batch multiple operations in the same request. For example, you might create multiple objects and perform a query in a single transaction.
The following shows the general syntax, where you substitute the HTTP method, URI, and body that you want.
[
  {
    "method": "HTTPMethod", "uri": "resourcePath", 
    "body": {bodyForOperation}, "result": "keepOrDispose"
  },
  {
    "method": "HTTPMethod", "uri": "resourcePath", 
    "body": {bodyForOperation}, "result": "keepOrDispose"
  },
  ...
]
Sample Body 
The following example provides an array of objects, each of which encapsulates a complete REST operation. The first operation creates a new Vehicle object, and the last operation performs a query.
[
  {
    "method": "post", "uri": "/v1/object",
    "body":
      { 
      "class": "FleetData.Vehicle",
      "attributes":
        { 
        "license": "XLT5663"
        }
      }, "result": "keep"
  },
  {
    "method": "post", "uri": "/v1/query",
    "body":
      {
        "query": "FROM FleetData.Customer WHERE rewardPoints > 25 RETURN *;",
        "language": "do"
      }, "result": "keep"
  }
]
Curl Example 
For more complex bodies such as transaction, you can provide the content in a file and submit it as follows:
curl -X POST -H "Content-Type:application/json,Accept:application/json" -d @myTransactionsFile.txt localhost:8185/v1/transaction
Response 
The response provides an array where each object includes the status code and response message for one operation in the transaction.
Status: 200 OK
[
  {
    "responseCode": 201,
    "result": {
      "__identifier__": "3-3-1-9",
      "uri": "/v1/object/3-3-1-9"
    }
  },
  {
    "responseCode": 200,
    "result": []
  }
]