Call a function asynchronously

Perform a function call. To provide input data to the function, add the data in an object called data in the request body. It will be available as the data argument into the function. Info about the function call at runtime can be obtained through the function_call_info argument if added in the function handle. WARNING: Secrets or other confidential information should not be passed via the data object. There is a dedicated secrets object in the request body to "Create functions" for this purpose.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
path Parameters
functionId
required
integer

The function id.

Request Body schema: application/json
data
object (data)

Input data to the function (only present if provided on the schedule). This data is passed deserialized into the function through one of the arguments called data. WARNING: Secrets or other confidential information should not be passed via the data object. There is a dedicated secrets object in the request body to "Create functions" for this purpose.'

nonce
string (nonce)

Nonce retrieved from sessions API when creating a session. This will be used to bind the session before executing the function. The corresponding access token will be passed to the function and used to instantiate the client of the handle() function. You can create a session via the Sessions API. When using the Python SDK, the session will be created behind the scenes when creating the schedule.

Responses
201

Created

400

The response for a failed request.

post/functions/{functionId}/call
Request samples
application/json
{
  • "data": {
    • "timeSeriesId1": 13435351,
    • "maxValue": 4
    },
  • "nonce": "string"
}
Response samples
application/json
{
  • "id": 1,
  • "status": "Running",
  • "startTime": 0,
  • "endTime": 0,
  • "error": {
    • "trace": "Cannot assign foo to bar.",
    • "message": "Could not authenticate."
    },
  • "scheduleId": 1,
  • "functionId": 1,
  • "scheduledTime": 0
}