PHPackages                             myfmbutler/myfmapilibrary-for-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. myfmbutler/myfmapilibrary-for-php

ActiveLibrary[API Development](/categories/api)

myfmbutler/myfmapilibrary-for-php
=================================

(Claris) FileMaker 19 API PHP wrapper

3.0.2(5y ago)204.3k—0%8[1 issues](https://github.com/myFMbutler/myFMApiLibrary-for-PHP/issues)[1 PRs](https://github.com/myFMbutler/myFMApiLibrary-for-PHP/pulls)gpl-3.0PHPPHP &gt;=5.5.0CI failing

Since Mar 7Pushed 4y ago4 watchersCompare

[ Source](https://github.com/myFMbutler/myFMApiLibrary-for-PHP)[ Packagist](https://packagist.org/packages/myfmbutler/myfmapilibrary-for-php)[ RSS](/packages/myfmbutler-myfmapilibrary-for-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (8)Used By (0)

Lesterius (Claris) FileMaker 19 Data API wrapper - myFMApiLibrary for PHP
=========================================================================

[](#lesterius-claris-filemaker-19-data-api-wrapper---myfmapilibrary-forphp)

Presentation
============

[](#presentation)

Team
----

[](#team)

[Lesterius](https://www.lesterius.com "Lesterius") is a European Claris (FileMaker) Business Alliance Platinum member that operates in Belgium, France, the Netherlands, Portugal and Spain. We are creative business consultants who co-create FileMaker Platform based solutions with our customers.
Sharing knowledge takes part of our DNA, that's why we developed this library to make the FileMaker Data API easy-to-use with PHP.
Break the limits of your application!
[![Lesterius logo](https://camo.githubusercontent.com/386f3e0002c229b9c44489b4263a77571822fe7fef7e0089367dbaf43ba7698b/687474703a2f2f69312e63726561746573656e64312e636f6d2f65692f722f32392f4433332f4446462f3138333530312f637366696e616c2f4d61696c696e675f4c65737465726975732d6c6f676f2e706e67 "Lesterius")](https://camo.githubusercontent.com/386f3e0002c229b9c44489b4263a77571822fe7fef7e0089367dbaf43ba7698b/687474703a2f2f69312e63726561746573656e64312e636f6d2f65692f722f32392f4433332f4446462f3138333530312f637366696e616c2f4d61696c696e675f4c65737465726975732d6c6f676f2e706e67)

Description
-----------

[](#description)

This library is a PHP wrapper of the (Claris) FileMaker Data API 19.

You can find the PHP wrapper of the FileMaker Data API 17 on the releases &lt;= v.1.\* .
You can find the PHP wrapper of the FileMaker Data API 18 on the releases &lt;= v.2.\* .

You will be able to use every functions like it's documented in your FileMaker server Data Api documentation (accessible via https://\[your server domain\]/fmi/data/apidoc). General Claris document on the Data API is available [here](https://help.claris.com/en/data-api-guide/)

Requirements
------------

[](#requirements)

- PHP &gt;= 5.5
- PHP cURL extension
- PHP mb\_string extension

Installation
------------

[](#installation)

The recommended way to install it is through [Composer](http://getcomposer.org).

```
composer require myfmbutler/myfmapilibrary-for-php
```

After installing, you need to require Composer's autoloader:

```
require_once __DIR__ . '/vendor/autoload.php';
```

Usage
=====

[](#usage)

Prepare your Claris (Filmaker) solution
---------------------------------------

[](#prepare-your-claris-filmaker-solution)

1. Enable the (Claris) FileMaker Data API option on your FileMaker server admin console.
2. Create a specific user in your (Claris) FileMaker database with the 'fmrest' privilege
3. Define records &amp; layouts access for this user

Use the library
---------------

[](#use-the-library)

### Login

[](#login)

Login with credentials:

```
$dataApi = new \Lesterius\FileMakerApi\DataApi('https://test.fmconnection.com/fmi/data', 'MyDatabase', null, 'filemaker api user', 'filemaker api password');
```

Login with oauth:

```
$dataApi = new \Lesterius\FileMakerApi\DataApi('https://test.fmconnection.com/fmi/data', 'MyDatabase', null, null, true, 'oAuthRequestId', 'oAuthIdentifier');
```

### Logout

[](#logout)

```
$dataApi->logout();
```

### Validate Session

[](#validate-session)

```
$dataApi->validateSession();
```

### Create record

[](#create-record)

```
$data = [
    'FirstName'         => 'John',
    'LastName'          => 'Doe',
    'email'             => 'johndoe@acme.inc',
    'RepeatingField(1)' => 'Test'
];

$scripts = [
    [
        'name'  => 'ValidateUser',
        'param' => 'johndoe@acme.inc',
        'type'  => Lesterius\FileMakerApi\DataApi::SCRIPT_PREREQUEST
    ],
    [
        'name'  => 'SendEmail',
        'param' => 'johndoe@acme.inc',
        'type'  => Lesterius\FileMakerApi\DataApi::SCRIPT_POSTREQUEST
    ]
];

$portalData = [
  'portalName or OccurenceName' => [
      [
          "Occurence::PortalField 1" => "Value",
          "Occurence::PortalField 2" => "Value",
      ]
  ]
];

try {
    $recordId = $dataApi->createRecord('layout name', $data, $scripts, $portalData);
} catch(\Exception $e) {
  // handle exception
}
```

### Delete record

[](#delete-record)

```
try {
  $dataApi->deleteRecord('layout name', $recordId, $script);
} catch(\Exception $e) {
  // handle exception
}
```

### Edit record

[](#edit-record)

```
try {
  $recordId = $dataApi->editRecord('layout name', $recordId, $data, $lastModificationId, $portalData, $scripts);
} catch(\Exception $e) {
  // handle exception
}
```

### Duplicate record

[](#duplicate-record)

```
try {
  $recordId = $dataApi->editRecord('layout name', $recordId, $scripts);
} catch(\Exception $e) {
  // handle exception
}
```

### Get record

[](#get-record)

```
$portals = [
    [
        'name'  => 'Portal1',
        'limit' => 10
    ],
    [
        'name'   => 'Portal2',
        'offset' => 3
    ]
];

try {
  $record = $dataApi->getRecord('layout name', $recordId, $portals, $scripts);
} catch(\Exception $e) {
  // handle exception
}
```

### Get records

[](#get-records)

```
$sort = [
    [
        'fieldName' => 'FirstName',
        'sortOrder' => 'ascend'
    ],
    [
        'fieldName' => 'City',
        'sortOrder' => 'descend'
    ]
];

try {
  $record = $dataApi->getRecords('layout name', $sort, $offset, $limit, $portals, $scripts);
} catch(\Exception $e) {
  // handle exception
}
```

### Find records

[](#find-records)

```
$query = [
    [
        'fields'  => [
            ['fieldname' => 'FirstName', 'fieldvalue' => '==Test'],
            ['fieldname' => 'LastName', 'fieldvalue' => '==Test'],
        ],
        'options' => [
            'omit' => false
        ]
    ]
];

try {
  $results = $dataApi->findRecords('layout name', $query, $sort, $offset, $limit, $portals, $scripts, $responseLayout);
} catch(\Exception $e) {
  // handle exception
}
```

### Set global fields

[](#set-global-fields)

```
$data = [
  'FieldName1'	=> 'value',
  'FieldName2'	=> 'value'
];

try {
  $dataApi->setGlobalFields('layout name', $data);
} catch(\Exception $e) {
  // handle exception
}
```

### Execute script

[](#execute-script)

```
try {
  $dataApi->executeScript('script name', $scriptsParams);
} catch(\Exception $e) {
  // handle exception
}
```

### Upload file to container

[](#upload-file-to-container)

#### Renaming file

[](#renaming-file)

```
$containerFieldName       = 'Picture';
$containerFieldRepetition = 1;
// replace 'upload' below with the name="value" of the file input element of your web form
$filepath                 = $_FILES['upload']['tmp_name'];
$filename                 = $_FILES['upload']['name'];

try {
  $dataApi->uploadToContainer('layout name', $recordId, $containerFieldName, $containerFieldRepetition, $filepath, $filename);
} catch(\Exception $e) {
  // handle exception
}
```

#### Without checking filename

[](#without-checking-filename)

```
$containerFieldName       = 'Picture';
$containerFieldRepetition = 1;
$filepath                 = '/usr/home/acme/pictures/photo.jpg';

try {
  $dataApi->uploadToContainer('layout name', $recordId, $containerFieldName, $containerFieldRepetition, $filepath);
} catch(\Exception $e) {
  // handle exception
}
```

### Metadata Info

[](#metadata-info)

#### Product Info

[](#product-info)

```
try {
  $dataApi->getProductInfo();
} catch(\Exception $e) {
  // handle exception
}
```

#### Database Names

[](#database-names)

```
try {
  $dataApi->getDatabaseNames();
} catch(\Exception $e) {
  // handle exception
}
```

#### Layout Names

[](#layout-names)

```
try {
  $dataApi->getLayoutNames();
} catch(\Exception $e) {
  // handle exception
}
```

#### Script Names

[](#script-names)

```
try {
  $dataApi->getScriptNames();
} catch(\Exception $e) {
  // handle exception
}
```

#### Layout Metadata

[](#layout-metadata)

```
try {
  $dataApi->getLayoutMetadata('layout name', $recordId);
} catch(\Exception $e) {
  // handle exception
}
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 76.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~76 days

Recently: every ~100 days

Total

7

Last Release

2162d ago

Major Versions

1.1.0 → 2.0.02019-07-15

2.0.1 → 3.0.02020-06-09

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39915415?v=4)[Lucie Guilbert](/maintainers/lguilbert)[@lguilbert](https://github.com/lguilbert)

---

Top Contributors

[![lguilbert](https://avatars.githubusercontent.com/u/39915415?v=4)](https://github.com/lguilbert "lguilbert (13 commits)")[![JacobTaylor-RCC](https://avatars.githubusercontent.com/u/39351909?v=4)](https://github.com/JacobTaylor-RCC "JacobTaylor-RCC (4 commits)")

---

Tags

apicomposerfilemakerphpwrapper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/myfmbutler-myfmapilibrary-for-php/health.svg)

```
[![Health](https://phpackages.com/badges/myfmbutler-myfmapilibrary-for-php/health.svg)](https://phpackages.com/packages/myfmbutler-myfmapilibrary-for-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M96](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
