StediDOCS
GuidesAPI Reference
This product is in Developer Preview

Functions

Functions let you build integrations and transform commercial documents without having to manage the complexity of setting up development environments, pipelines, and deployments.

Authorization - API Key generated in Stedi terminal

Tests a functionDev preview

POST/test

Executes a function with provided input and returns the result.

Parameters

No parameters

Request body

application/json

Requiredstring
Function code. The value must be a string.
Requiredstring
JSON stringified input which will be passed to the function as a first parameter. The value must be a string.
Optionalstring
JSON stringified parameter sets which will be passed to the function inside context object. The value must be a string.
Optionalobject
A map of additional string values passed to the function as a context.
object object.

Example

POST
https://functions.stedi.com/2021-06-01/test

List functionsDev preview

GET/functions

Retrieves a list of available functions for current tenant (metadata only).

Parameters
Optionalquery
Maximum number of functions to fetch. The value can range between 1 and 50, the default is 25.
Optionalquery
Last next_page_token seen in prior request from which to continue pagination The value must be a string.

Example

GET
https://functions.stedi.com/2021-06-01/functions?page_size=20&page_token=2t7M75ZN1w4OnYFKKT0SUkT95w_ULzPR...

Create a new functionDev preview

POST/functions

Creates a new function.

Parameters

No parameters

Request body

application/json

Requiredstring
Function code. The value must be a string.
Requiredstring
Name of the function. The value must be a string.

Example

POST
https://functions.stedi.com/2021-06-01/functions

Get a functionDev preview

GET/functions/{function_id}

Retrieves given function.

Parameters
Requiredpath
id of the function. The value must be a string.

Example

GET
https://functions.stedi.com/2021-06-01/functions/e463a1c6-82c8-4fbc-9a7a-fe64d7f6d12b

Update a functionDev preview

PUT/functions/{function_id}

Updates a function. Either or both code and name have to be provided.

Parameters
Requiredpath
id of the function. The value must be a string. The value must be a string. The value must be a string.
Request body

application/json

Optionalstring
The value must be a string.
Optionalstring
The value must be a string.

Example

PUT
https://functions.stedi.com/2021-06-01/functions/f279088a-69f8-487f-bb4f-e4ec25189e58

Delete a functionDev preview

DELETE/functions/{function_id}

Permanently deletes a function.

Parameters
Requiredpath
id of the function. The value must be a string. The value must be a string.

Example

DELETE
https://functions.stedi.com/2021-06-01/functions/31b2902c-7da9-4cec-b90d-18b274d83ad0

Invoke a functionDev preview

POST/functions/{function_id}/invoke

Invoke a function with provided input.

Parameters
Requiredpath
id of the function to invoke. The value must be a string.
Request body

application/json

Optional

JSON stringified input which will be passed to the function as a first parameter. Only one of input and input_url parameters can be specified.

Optionalstring

input document URL. The document cannot exceed 16MB. Only one of input and input_url parameters can be specified. The value must be a string.

Optionalstring
output document URL, destination where Functions write the result of invocation. URL must accept a PUT request with a body containing invocation result and return 2xx status. If output_url is present, this endpoint won't return invocation result. The value must be a string.
Optionalobject
A map of additional string values passed to the function as a context.
object object.

Example

POST
https://functions.stedi.com/2021-06-01/functions/6b324d9b-2a77-452d-a4d2-b735e35f0df5/invoke