filemaker_odata_api

A typed Dart client for the Claris FileMaker OData v4 API, with a fluent $filter query builder. Works anywhere Dart runs: Flutter (iOS, Android, macOS, Windows, web), server-side Dart, and CLI tools.

Not affiliated with or endorsed by Claris International Inc. "FileMaker" and "Claris" are trademarks of Claris International Inc.

OData vs the Data API

This is the companion to filemaker_data_api. They are different APIs, not two flavours of one:

OData (this package) Data API
Auth HTTP Basic, every request Session token
Addresses Base tables Layouts
Query OData v4 ($filter, $select, ...) Find requests / found sets
Standard OData 4.01 FileMaker-specific

Pick OData for standards-based tooling and ad-hoc querying; pick the Data API for layout-scoped access, portals, and script results.

Install

dependencies:
  filemaker_odata_api: ^0.1.0

Usage

import 'package:filemaker_odata_api/filemaker_odata_api.dart';

final od = ODataClient(
  host: 'https://fms.example.com',
  database: 'Contacts',
  username: 'admin',
  password: 'secret',
);

final result = await od.query(
  table: 'Contacts',
  filter: Filter.equals('state', 'NSW').and(Filter.greaterThan('age', 21)),
  select: ['id', 'name', 'state'],
  orderBy: [const OrderBy('name')],
  top: 50,
  count: true,
);

print('${result.rows.length} of ${result.count}');
for (final row in result.rows) {
  print('${row['id']}: ${row['name']}');
}

od.close();

Building filters

Filter.equals('state', 'NSW')            // state eq 'NSW'
Filter.greaterThan('age', 21)            // age gt 21
Filter.contains('name', 'an')            // contains(name,'an')
Filter.equals('name', "O'Brien")         // name eq 'O''Brien'  (auto-escaped)

Filter.equals('state', 'NSW')
    .and(Filter.greaterThan('age', 21))  // (state eq 'NSW') and (age gt 21)
    .not()                               // not (...)

Filter.raw("year(created) eq 2026")      // escape hatch for raw expressions

Error handling

Exception When
ODataAuthException HTTP 401
ODataNotFoundException HTTP 404
ODataTransportException Host unreachable or non-JSON response
ODataException Any other error status

Requirements

  • FileMaker Server or FileMaker Cloud with OData access enabled.
  • A FileMaker account whose privilege set allows the OData/fmodata extended privilege.

License

MIT

Libraries

filemaker_odata_api
A typed Dart client for the Claris FileMaker OData v4 API.