Batch requests

OData supports batch requests that enable you to perform multiple operations in a single HTTP request. You can use record-level operations, such as create a record, edit a record, delete a record, and find a record. Alternatively, you can create a set of atomic operations which run independently of other processes.

Component Description

HTTP method

POST

URL

https://host/fmi/odata/version/database-name/$batch

host – FileMaker Cloud or FileMaker Server host name

version – the OData version, always v4

database-name – the name of the hosted database

$batch - the name of batch

Example: /fmi/odata/v4/ContactMgmt/$batch

Parameters

Example:

Copy
POST https://host/fmi/odata/v4/ContactMgmt/$batch
OData-Version: 4.0
Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b
Authorization: FMID Claris_ID_Token
Content-Type: application/http

GET https://host/fmi/odata/v4/ContactMgmt/Contacts(1) HTTP/1.1

--batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Type: multipart/mixed; boundary=changeset_77162fcd-b8da-41ac-a9f8-9357efbbd

--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd
Content-Type: application/http
Content-ID: 1

POST https://host/fmi/odata/v4/ContactMgmt/Contacts HTTP/1.1
Content-Type: application/json
Content-Length: 162

{
  "PrimaryKey": "BJONES",
  "Name": "Bob Jones",
  "Zone": 1,
  "Title": "SouthWest Sale Manager",
  "Company": "Example, Inc.",
  "Website": "www.example.com"
}

--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd
Content-Type: application/http
Content-ID: 2

PATCH https://host/fmi/odata/v4/ContactMgmt/Contacts(1) HTTP/1.1
Content-Type: application/json
Content-Length: 32

{
  "Title": "Software Engineer"
}

--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd
Content-Type: application/http
Content-ID: 3

DELETE https://host/fmi/odata/v4/ContactMgmt/Contacts(7) HTTP/1.1

--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd--
--batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Type: application/http

GET https://host/fmi/odata/v4/ContactMgmt/Contacts(1) HTTP/1.1

--batch_36522ad7-fc75-4b56-8c71-56071383e77b--

FileMaker information

  • Specify the Content-Type header as multipart/mixed and include a boundary specification.

  • The body of a batch request is made up of a series of individual requests and change sets.

  • Batch requests do not support referencing newly created records using $<Content-ID> in a change set.