Transforms API

circle-exclamation

The transforms API allows Spark services to be used as a "drop-in" replacement to legacy calculation systems and services. This works by supporting requests and responses structures that do not conform to the payload structure of the standard .

Transforms are not inherently tied to a particular Spark service and can have a many-to-many relationship. This enables:

  • Reuse of one transform against multiple services.

  • One service can have different transforms applied to it, e.g. a service is consumed by multiple calling systems.

To support this functionality we have developed different Transform types that may be appropriate for different use cases.

Build transforms

To build transforms you can follow the instructions under Transform types to build the code for transforms. For JavaScript developers there is also the Node Transform Document Builderarrow-up-right that can be used to assist with the development.

Transform APIs

Please see the additional specifics for the Transform types you are using.

Authorization

  • Bearer {token} accessible from Authorization - Bearer token or systematically via Client Credentials.

    • The request headers should include a key for Authorization with the value Bearer {token}.

  • API key created from Authorization - API keys.

    • The request headers should include the keys x-synthetic-key and x-tenant-name with the values of the API key and tenant name respectively.

Note that the authorization must include permissions that can access:

  • The requested Spark service.

  • The requested transform.

    • Either the folder that the transform is stored OR

    • If the transform is in the apps/transforms folder. This would typically require user:pf or supervisor:pf.

Path parameters

Key
Value

tenant *

Tenant is part of your Log in to Spark URL and also available in the User menu.

transform_folder *

Folder associated with the transform document of the request.

transform *

Transform document associated with the transform document of the request (without _transform.json).

folder *

Folder associated with the Spark service of the request.

service *

Service associated with the Spark service of the request.

Request headers

Key
Value

x-transforms-path

Folder name if the transform document is stored in a folder and the URI pattern does not include transform_folder.

Request body

Response body

  • Content will differ depending on the Transform types.

  • If the transform encounters an error, the error from the transform application will be returned.

Last updated