UDFCALLAPI

This legacy function allows the user to call Spark service API through Coherent Assistant.

circle-exclamation

Syntax

CS.SPARK_UDFCALLAPI([UDFCallTableRange])

  • XCallTableRange: Required. Range address of the XCall block in upstream service. E.g. $A$1:$B$4. You can also use a named range for convenience.

UDFCall Block

Create an UDFCall block in the Excel workbook (upstream service) to make an API call. The UDFCall block can be anywhere in your workbook but must be on the same sheet as your Spark_UdfCallAPI function.

  • This table needs to include

    • CALLTYPE: SparkService

    • FOLDERNAME: name of the folder containing downstream service.

    • SERVICENAME: name of downstream service.

    • REQUESTBODY: payload for calling downstream service. Must be in JSON format. You can copy the REQUESTBODY from downstream service API tester. If this is your first time using the SparkService we encourage to leave content of "request_meta" empty. Spark will use the latest version and the default Service Type to execute this service.

  • XCall block example

  • REQUESTBODY example (v3 format)

Output

The function will return a JSON formatted string with two parts.

  • The first, metadata, contains information about the call to the downstream service such as status, error_code, and response_time.

  • The second, data, contains the response body of the downstream service.

Response from Spark (example):

Last updated