Write OData API calls

OData calls consist of the following components.

Component

Description

HTTP method

OData uses the following HTTP methods:

HTTP headers

OData uses the following headers:

  • Authorization: must be provided with all requests in the following format:

    • Claris ID token (FMID Claris_ID_token)

    See Creating an authenticated connection to the host.

    Note  For FileMaker Server, OData requires a base64-encoded string with the account name and password that you used to sign in to the hosted database. The base64-encoded string should follow a standard HTTP Basic authentication scheme, where the account name and password are separated by a colon. Use the following format for the header: Authorization Basic [base64encoded of username:password]. See FileMaker Server Help.

  • Accept: indicates the format of the expected response. If specified, must be one of the following:

    • application/json (default)

    • application/atom+xml (or application/xml)

    • text/html

    For JSON applications, the following JSON-specific option is supported: IEEE754Compatible=true and indicates that fields with type Edm.Int64 and Edm.Decimal are returned as string values. See OData 4.0 JSON format.

    The value is overridden by the value of $format query option, if specified. See "Header Accept" in OData 4.0 Protocol.

  • Content-Type: indicates the format of the request body for POST and PATCH methods. If specified, it must be one of the following:

    • application/json (default)

    • application/atom+xml (or application/xml)

    • multipart/mixed (for $batch operations)

    See "Header Content-Type" in OData 4.0 Protocol.

  • OData-Version: indicates the version of the OData protocol. FileMaker Cloud and FileMaker Server support OData 4.0. See "Header OData-Version" in OData 4.0 Protocol.

  • OData-MaxVersion: indicates the maximum version for OData protocol. FileMaker Cloud and FileMaker Server support OData 4.0. See "Header OData-MaxVersion" in OData 4.0 Protocol.

  • Prefer: the following values are supported:

    • odata.continue-on-error

    • odata.maxpagesize

    • return=representation

    • return=minimal

    See "Header Prefer" in OData 4.0 Protocol.

URL

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

host – FileMaker Cloud or FileMaker Server host name

version – the OData version, always v4

database-name – the name of the hosted database

Example: /fmi/odata/v4/ContentMgmt

Parameter data in JSON and Atom Example For POST and PATCH methods only.