Run a script

To independently run a FileMaker script, use an HTTP GET method with the script API endpoint.

HTTP method

GET

URL

/fmi/data/version/databases/database-name/layouts/layout-name/script/script-name

version – the FileMaker Data API version requested can use v1, v2, or vLatest

database-name – the name of the hosted database

layout-name – the name of the layout to use as the context for running the script

script-name - the script that you want to run

HTTP header

Content-Type: application/json

Authorization: Bearer session-token, where session-token is the unique X-FM-Data-Access-Token value for the database session

Parameters

script.param - The text string to use as a parameter for the script that was named by script-name.

For example: https://<host>/fmi/data/vLatest/databases/customers/layouts/entry/script/UpdateProcessing?script.param=14

Response

When the script is executed successfully, the response looks like this example:

Copy

{
    "response":{
      "scriptError":"0"
 },
 "messages":[
      {
      "code":"0",
      "message":"OK"
  }
 ]
}

See Error responses.

Notes 

  • When using FileMaker Data API to run a script, make sure that the script has a unique name. If there are multiple scripts with the same name, FileMaker Data API cannot control which script is called, even if the scripts are in different folders.