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.
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. |
Parameters |
The For example: Copy
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
-
FileMaker databases are the only external data sources supported. Specify the database name without the .fmp12 filename extension.
-
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.