Log in to an external data source
If your hosted database needs to log in to an external data source, the hosted database name is specified in the URL; the account name and password for the hosted database are specified in a header Authorization string; and the database name, account name, and password for the external data source are specified in the fmDataSource
parameter as a JSON array.
For a database hosted on the Claris platform, use the extended Claris account name and password you set in Claris Studio. See “Create an extended Claris account for Claris Server services” in Claris Studio Help Center.
HTTP method |
POST |
URL |
/fmi/data/version/databases/database-name/sessions version – the FileMaker Data API version requested can use database-name – the name of the hosted database |
HTTP header |
Content-Type: application/json Authorization: a base64-encoded string representing the account name and password to use to log in to the hosted database. This base64-encoded string should follow the standard HTTP Basic Authentication Scheme. For a database hosted on the Claris platform, use the extended Claris account name and password you set in Claris Studio. |
Parameters |
The For example: Copy
FileMaker Server only: To use an OAuth account to log in to the external data source, specify the X-FMS-Request-ID header value ( Copy
|
Response |
The access token, an empty response body, and a messages array showing an error code of 0. The X-FM-Data-Access-Token header is returned in response, which is the session token to be used for subsequent API calls. For example: Copy
See Error responses. |
Notes
-
Claris and FileMaker databases are the only external data sources supported. Specify the database name without the extension:
-
For a Filemaker database, remove .fmp12 filename.
-
For a Claris database, remove .claris.
-
-
Files listed in the
fmDataSource
parameter will be opened as needed, for example, when a script is run or when the context is changed to a layout that requires the external data source. As a result, errors with logging in to the external data source happen when attempting to open the files, not when logging in to the database session.