Integrations / SAP Datasphere
SAP Datasphere
SAP Datasphere (SAP Business Data Cloud): run, retry and cancel task chains, read task run status, logs and history, list and validate connections, plus a guarded read of other /api/v1/datasphere/ paths such as the catalog and consumption APIs. Connect with an OAuth client of purpose 'Technical User' created in System > Administration > App Integration. The task chain and connection paths come from SAP's documentation; Setu has not tested this against a live Datasphere tenant. Task chain run/retry/cancel in SAP's text do not mention a CSRF token, but the connections API text says writes need one: if a tenant answers 403 on a run, report it.
10 actions
token_login
7 read3 write
Calls api.sap.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "sap_datasphere" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Read from the SAP Datasphere APIreadsap_datasphere.api_getGuarded GET to another SAP Datasphere REST or OData path under /api/v1/datasphere/ (tasks, spaces, consumption). Use it for the catalog and consumption APIs (SAP Business Accelerator Hub package 'SAP Datasphere' lists Catalog and Consumption). UNVERIFIED shapes that third-party projects report on real tenants, confirm on your tenant: /api/v1/datasphere/consumption/catalog/spaces, /api/v1/datasphere/consumption/catalog/spaces('SPACE')/assets, /api/v1/datasphere/consumption/relational/SPACE/ASSET with OData v4 options $top $select $filter $orderby $skip. Space and asset names are upper-case technical names. Never guess a path the user did not give or you did not see in a previous reply.
| Input | Type | Description | |
|---|---|---|---|
path | string | Required | Path starting with /api/v1/datasphere/, for example /api/v1/datasphere/consumption/catalog/spaces |
query | object | Optional | Plain query parameters such as {"$top": "10"} |
await setu.execute({
userId: "user_1",
action: "sap_datasphere.api_get",
input: {
"path": "<path>"
},
});Cancel task chain runwritesap_datasphere.cancel_task_chainCancel a running task chain in SAP Datasphere, identified by the log id of the run (from run_task_chain or get_task_history). Work already done by finished steps is not undone.
| Input | Type | Description | |
|---|---|---|---|
space_id | string | Required | Technical name of the space (upper case), e.g. SALES_SPACE |
log_id | integer | Required | Log id of the running task chain |
await setu.execute({
userId: "user_1",
action: "sap_datasphere.cancel_task_chain",
input: {
"space_id": "<space_id>",
"log_id": 1
},
});Get connection definitionreadsap_datasphere.get_connectionRead the JSON definition of one connection in an SAP Datasphere space, without its credentials. The documentation gives the path but no sample reply, so the reply is returned as SAP sends it.
| Input | Type | Description | |
|---|---|---|---|
space_id | string | Required | Technical name of the space (upper case), e.g. SALES_SPACE |
connection_name | string | Required | Technical name of the connection |
await setu.execute({
userId: "user_1",
action: "sap_datasphere.get_connection",
input: {
"space_id": "<space_id>",
"connection_name": "<connection_name>"
},
});Get task run historyreadsap_datasphere.get_task_historyList the earlier runs (log id, status, start and end time, user) of one object such as a task chain in an SAP Datasphere space, newest first. Use it to find the log id to pass to get_task_log, retry or cancel.
| Input | Type | Description | |
|---|---|---|---|
space_id | string | Required | Technical name of the space (upper case), e.g. SALES_SPACE |
object_id | string | Required | Technical name of the object, e.g. a task chain |
await setu.execute({
userId: "user_1",
action: "sap_datasphere.get_task_history",
input: {
"space_id": "<space_id>",
"object_id": "<object_id>"
},
});Get task run logreadsap_datasphere.get_task_logGet the detailed log of one task run in SAP Datasphere: status, start and end time, the child steps of a task chain and the log messages. Use it to find out why a chain failed.
| Input | Type | Description | |
|---|---|---|---|
space_id | string | Required | Technical name of the space (upper case), e.g. SALES_SPACE |
log_id | integer | Required | Log id of the task run |
await setu.execute({
userId: "user_1",
action: "sap_datasphere.get_task_log",
input: {
"space_id": "<space_id>",
"log_id": 1
},
});Get task run statusreadsap_datasphere.get_task_statusGet the status (for example RUNNING, COMPLETED, FAILED, CANCELED) of one task run in SAP Datasphere from its log id. Use get_task_log for messages and child steps.
| Input | Type | Description | |
|---|---|---|---|
space_id | string | Required | Technical name of the space (upper case), e.g. SALES_SPACE |
log_id | integer | Required | Log id of the task run |
await setu.execute({
userId: "user_1",
action: "sap_datasphere.get_task_status",
input: {
"space_id": "<space_id>",
"log_id": 1
},
});List connections in a spacereadsap_datasphere.list_connectionsList the connections defined in an SAP Datasphere space. The documentation gives the path but no sample reply, so the reply is returned as SAP sends it. Credentials are not included. Connections of custom connection types are not listed by this API.
| Input | Type | Description | |
|---|---|---|---|
space_id | string | Required | Technical name of the space (upper case), e.g. SALES_SPACE |
await setu.execute({
userId: "user_1",
action: "sap_datasphere.list_connections",
input: {
"space_id": "<space_id>"
},
});Retry failed task chainwritesap_datasphere.retry_task_chainRetry the last run of a task chain in SAP Datasphere. Valid only for a FAILED or CANCELED chain, and only while that run is still the object's last run. Returns the log id of the retry.
| Input | Type | Description | |
|---|---|---|---|
space_id | string | Required | Technical name of the space (upper case), e.g. SALES_SPACE |
object_id | string | Required | Technical name of the task chain |
await setu.execute({
userId: "user_1",
action: "sap_datasphere.retry_task_chain",
input: {
"space_id": "<space_id>",
"object_id": "<object_id>"
},
});Run task chainwritesap_datasphere.run_task_chainStart a run of a task chain in an SAP Datasphere space. Returns the log id of the new run, which get_task_status and get_task_log accept. Task chains may load or replicate data, so confirm with the user first. Optional input_parameters only work if the chain defines input parameters.
| Input | Type | Description | |
|---|---|---|---|
space_id | string | Required | Technical name of the space (upper case), e.g. SALES_SPACE |
object_id | string | Required | Technical name of the task chain |
input_parameters | object | Optional | Optional name/value pairs for a task chain defined with input parameters |
await setu.execute({
userId: "user_1",
action: "sap_datasphere.run_task_chain",
input: {
"space_id": "<space_id>",
"object_id": "<object_id>"
},
});Validate connectionreadsap_datasphere.validate_connectionAsk SAP Datasphere to validate a connection in a space (can it reach its source system with the saved credentials). The documentation gives the path but no sample reply, so the reply is returned as SAP sends it.
| Input | Type | Description | |
|---|---|---|---|
space_id | string | Required | Technical name of the space (upper case), e.g. SALES_SPACE |
connection_name | string | Required | Technical name of the connection |
await setu.execute({
userId: "user_1",
action: "sap_datasphere.validate_connection",
input: {
"space_id": "<space_id>",
"connection_name": "<connection_name>"
},
});