Call Spark service APIs (Xcall)

Xcall is designed for users to call other Spark service APIs inside one service

Introduction

By connecting Spark services together, users can use data from different sources and to better externalize calculations and data. The Xcall has 2 parts, the Xcall block to define the request, and a user-defined function, to receive responses. Multiple Xcalls can be included in a single Spark Service.

Prerequisites

  • Two Spark services are required. One is upstream, to make an API request and receive a response. The other one is downstream, to give an API response depending on the request from upstream.

  • Coherent Assistant is required to help build the CS.SPARK_XCALL() user-defined function to connect the two services through a native Excel function.

  • Both Spark services must be uploaded under the same tenant and accessible with the same credentials.

XCall: Flow of Data

Downstream Service

This is a usual Spark service that provides data to the upstream service when an Xcall is executed in the upstream service. This file will contain usual Xinputs and Xoutputs which will be used as parameters when called from the upstream service. This file would not contain any custom/user-defined functions.

Upstream Service

This Spark service uses Xcall to call an API to get data from the downstream service by passing the necessary parameters. The Excel file for this service would contain the Xcall block as well as custom/user-defined functions to execute the API call.

Last updated