• No results found

Exploring FileMaker Server Admin APIs

N/A
N/A
Protected

Academic year: 2021

Share "Exploring FileMaker Server Admin APIs"

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)

© 2018 FileMaker, Inc.

FILEMAKER DEVCON 2018

AUGUST 6-9 | GRAPEVINE, TX

Exploring FileMaker Server

Admin APIs

INT08

Melody Hsu

(2)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Who am I?

Melody Hsu

Engineer Manager at FileMaker, Inc.

Areas of Involvement:

- WebDirect

- Custom Web Publishing with PHP/XML

- Admin Console - Admin APIs

(3)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Agenda

FileMaker Server Management in 17

Admin API Overview

Admin API Structure

Admin API Execution

Demos

Integration with Admin APIs

(4)

#FileMakerDevCon

© 2018 FileMaker, Inc.

FileMaker Server Management in 17

Admin Console

- Simple, interactive with improved UI and UX

Command Line

- Advanced and comprehensive set of configuration

Admin APIs (Trial)

(5)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Overview

APIs

for managing your FileMaker Server

Complement

to FileMaker Admin Console and Command Line

{api}

(6)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Overview - Functionality

Create/Edit/Run Schedules

Disconnect Clients

Manage Database Files

(7)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Overview

Protocol

- Only supported through HTTPS

Sessions

- maximum of 5 Admin API sessions

Session Token

(8)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Overview

Asynchronous

- All database operations expect list databases - Disconnect client

- Run schedule

- Configure PHP technology if enabling/disabling or changing to use FileMaker PHP

Synchronous Operations

(9)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Overview - Admin vs Data APIs

Admin APIs (Trial)

- Uses root admin account for authentication - Performs FileMaker Server administration

operations

- RESTful-based using HTTPS

- Requests processed through node.js process

shared with Admin Console on master FMS machine

- Own request/response formats and error

handling

Data APIs

- Uses database solution accounts for

authentication

- Performs database solution operations - RESTful-based using HTTPS

- Requests processed through separate node.js

and C++ process on master FMS machine

- Own request/response formats and error

(10)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Overview - Server vs Cloud

Server vs Cloud Admin APIs (Trial)

- Both uses root admin account for authentication

- Both performs FileMaker Server administration operations - Both are RESTful-based using HTTPS

- Requests processed through node.js process shared with Admin Console on Server master

machine or Cloud instance

- Request/response formats differ slightly - Validation of request differ slightly

- Using 0 as the id to perform actions on all is only supported in Cloud - Cloud only includes a subset of all APIs, including schedules API

(11)

#FileMakerDevCon

© 2018 FileMaker, Inc.

(12)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Structure

HTTP Request

URI Endpoint

Method

Header

Payload Body

HTTP Response

Status Code

Response Header

Response Message

(13)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Structure - Request URL

Request URL

SCHEME

https://

www.mydomain.com

HOST

/fmi/api/v1/databases

PATH

URI Endpoint

(14)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Structure - Request Method

CRUD Operation

HTTP Request Method

Read

GET

Create

POST

Replace

PUT

Update

PATCH

Delete

DELETE

(15)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Structure - Request Payload

JSON Format: Key-value pairs surrounded by curly braces

Strict parameter value types

Config PHP API Example (Request Payload):

{

"enabled"

:

true

,

"useFileMakerPhp"

:

true

,

"characterEncoding"

:

"UTF-8"

,

"dataPreValidation"

:

false

,

"errorMessageLanguage"

:

"en"

}

(16)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Structure - Response Code

HTTP Status Code

200 - Success

400 - Bad Request

401 - Unauthorized

404 - Not Found

477 - FileMaker Error

500 - Internal Server Error

503 - Server Unavailable

(17)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Structure - Response Payload

{

"result"

: 0,

"token"

: “eyJhbGciOiJIUzI1N…”

}

{

"result"

:

212

,

“errorMessage”

:

"Invalid

user account and/or password"

}

POST /fmi/admin/api/v1/user/login

(18)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Structure - HTTP Request

Request Line

PATCH /fmi/admin/api/v1/php/config HTTP/1.1

Header

Host: www.mydomain.com

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR…

Content-Type: application/json

<other header paramaters>

Blank Line

Payload (Body)

{

"enabled"

:

true

,

"useFileMakerPhp"

:

true

}

(19)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Structure - HTTP Response

Status Line

HTTP/1.1 200 OK

Header

Date: Wed, 8 Aug 2018 19:23:41 GMT

Server: Apache/2.4.28 (Unix) LibreSSL/2.2.7

Content-Type: application/json; charset=utf-8

Content-Length: 754

<other header parameters>

Blank Line

Response

Message Body

{

"result"

: 0,

}

(20)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Structure - APIDoc

(21)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Execution

(3) Call {api}

(1) Install & Setup

FileMaker Server

(2) Get session token

Token =

“eyJhbGciOiJIUzI…”

(4) Invalidate token

Token =

(22)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Execution

(23)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Admin API Execution

(24)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Integration with Admin APIs

Connor Brock

Customer Success Engineer at FileMaker, Inc.

(25)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Resources

FileMaker API Doc

https://<servername>/fmi/admin/apidoc

<installation path>/FileMaker Server/Documentation/Admin API Documentation/ index.html

FileMaker Cloud 17 Admin API Guide (Only use as reference)

https://fmhelp.filemaker.com/cloud/17/en/adminapi

FileMaker Error Codes

https://fmhelp.filemaker.com/help/17/fmp/en/index.html#page/FMP_Help/error-codes.html

(26)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Conclusion

Admin APIs are powerful and flexible

- can be integrated with any tool that supports HTTP requests - allows automation of common admin tasks

- allows for easy management of multiple servers - allows for your own custom admin console GUI

Admin APIs are a game changer!!!

NOTE: With power comes responsibility. Make sure to use the right

tool for the right job.

(27)

#FileMakerDevCon

© 2018 FileMaker, Inc.

Session Updates

This session WILL have updates.

www.filemaker.com/devcon/speaker_updates

(28)

#FileMakerDevCon

© 2018 FileMaker, Inc.

FILEMAKER DEVCON 2018

AUGUST 6-9 | GRAPEVINE, TX

Thank You!

Please remember to fill out the session evaluation at:

www.filemaker.com/devcon/speaker_updates www.filemaker.com/devcon/evaluations

References

Related documents

After you enable remote administration, you can use FileMaker Server Admin on a remote computer to configure FileMaker Server properties, view a list of hosted databases, view

To access external FileMaker data sources in FileMaker WebDirect, all referenced database files must be hosted on the same FileMaker Server deployment as the FileMaker

To access external FileMaker data sources in FileMaker WebDirect, all referenced database files must be hosted on the same FileMaker Server deployment as the FileMaker

Missing information The following electronic documentation isn’t installed with FileMaker Server 7.0v1: FileMaker Instant Web Publishing Guide , FileMaker Server Advanced Custom

For detailed information about using Admin Console to administer FileMaker Pro databases and clients that are connected to hosted databases, see FileMaker Server Help.. About

If you host files using FileMaker Server or FileMaker Server Advanced, you can create external server accounts that are authenticated by Active Directory or Open Directory..

• Use the Server menu to edit your deployment, to save and load the schedules and groups settings file, to test whether database hosting is working correctly, and to view additional

For detailed information about using Admin Console to administer FileMaker Pro databases and clients that are connected to hosted databases, see FileMaker Server Help.. About