The Schedule Publication API is designed to facilitate the seamless integration of scheduling functionalities for selected reports within the SAP Analytics Cloud. This API enables partners and customers to programmatically manage the publication of reports, ensuring that all actions typically performed through the user interface can also be executed via API calls.
This API is particularly beneficial for customers seeking event-based scheduling, as it allows for the creation and triggering of publication schedules in response to specific events. By leveraging the capabilities of the Schedule Publication API, users can automate workflows, enhance operational efficiency, and ensure the timely delivery of critical reports. Whether it's initiating a schedule based on an external trigger or managing report publications on a recurring basis, this API provides the flexibility and control needed to streamline the reporting process.
This is available from QRC4.2024 and in fast track tenant it is available from Version 2024.21
API Description Method Endpoint Usage
API | Description | Method | EndPoint | Usage |
Template API | Retrieves a prefilled JSON payload for creating, updating, or deleting schedules. | GET | /api/v1/storyPublication/schedules/template | Get this template, then modify the placeholder values based on the requirement and use it for Creating or updating the Schedule. |
Create API | Establish a new single or recurring Schedule Publication. | POST | /api/v1/storyPublication/schedules | Send your modified JSON payload from the template to create a schedule. |
Update API | Modify specific properties of an existing Schedule Publication. | PATCH | /api/v1/storyPublication/schedules/scheduleID | Make modifications without needing to recreate the entire schedule. |
Delete API | Remove a single schedule or a series of schedules. | DELETE | /api/v1/storyPublication/schedules/scheduleID | Clean up outdated or unnecessary schedules easily. |
Get Schedule API | Retrieve details of a specific Schedule Publication by its ID. | GET | /api/v1/storyPublication/schedules/scheduleID | Fetch the details of the specified schedule. |
Note: Replace scheduleID with the ID of the schedule you want to update, delete, or retrieve.
The following payload will be returned by the template API:
{
"storyId": "",
"scheduleName": "",
"recurrenceType": 1,
"runNow": true,
"scheduleMode": 0,
"runOnceStartDate": "2024-10-14T15:02:56.111Z",
"recurrence": [
{
"recurrenceMode": 3,
"endMode": {
"endModeRepetitions": 2,
"endModeDate": null
},
"onMonday": false,
"onTuesday": false,
"onWednesday": false,
"onThursday": false,
"onFriday": false,
"onSaturday": false,
"onSunday": false,
"firstRun": "2024-10-14T15:02:56.111Z",
"dayCount": 30
}
],
"addStoryLink": true,
"fileFormat": "PDF",
"emailSubject": "",
"emailMessage": "",
"deliveryOption": 0,
"timezoneFullName": "",
"views": [
{
"bookmarkId": "STORY",
"viewName": "view 1",
"filename": "Sample",
"fileSettings": {
"selectedStoryPages": [],
"includeAppendix": true,
"appendixIncludeDate": true,
"resolution": "1920,1080",
"includeComments": false,
"pageSize": "Auto"
},
"destinations": {
"email": {
"extEmailUsr": [],
"internalEmailUsr": []
}
}
}
],
"xsTimeTaken": 53
}
Having administrator privileges on our SAC tenant, we can register an OAuth-client in the App Integration tab of the administration page. We navigate to the administration page by clicking on ≡ (Main Menu) -> System -> Administration.
Within the App Integration tab (1), we are now able to register a new OAuth client by clicking on +Add New OAuth Client (2).
This will open the dialog for registering a new OAuth Client as shown below:
The diagram below shows the Authorization Code Grant flow for our context and helps you implement it. The end-user authorizes an application to access a protected resource on the Service Provider (SP) and must interact with the IdP (authorization server).
Please note that the SCP Authentication Service is the default IdP but can be changed.
Our custom application should first direct the user to the authorization server's authorization endpoint (Authorization URL). After obtaining the authorization code, the application must exchange it for an access token by making a POST request with the authorization code to the token endpoint (Token URL).
You can find the Authorization URL and Token URL in the App Integration tab under OAuth Clients on SAC's administration page.
Open Postman and create a new collection.
Go to the Authorization page and fill in the following details to get a new access token:
Click on "Get New Access Token." This will open your browser for user authentication. Once authentication is complete, you will be redirected to Postman with the token.
Use the access token obtained to call the endpoints.
CSRF Token: You will need the CSRF token to call the API endpoints. Use the following code in the Pre-Request script to get and set the csrf_token header:
const getAppInstancePropsRequest = {
url: "https://<tenant-url>/api/v1/csrf",
method: 'GET',
header: { 'Content-Type': 'application/json' , 'Authorization': 'Bearer ' + pm.collectionVariables.get("bearer.token"), 'x-csrf-token': 'fetch',
'x-sap-sac-custom-auth': "true" }
};
pm.sendRequest(getAppInstancePropsRequest, function (err, response) {
console.log(response)
var csrfToken = response.headers.get("x-csrf-token");
pm.collectionVariables.set("csrf_token", csrfToken);
})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.