cancel
Showing results for 
Search instead for 
Did you mean: 

Send alert notification with Workflow Service Task

Giampaolo
Explorer
0 Kudos

Hi folks,
after successfully sending notifications via custom ui-module, the new feat your hero is venturing into is sending notifications using workflow service tasks.

The steps performed are:
1. the creation of the token in the start-ui-module that I put in the WF context;
2. preparing the request to be used in the POST call via a Script Task and also placing it in the WF contest

The configuration of the Service Task is this

and

After starting the Workflow, it fails with this message:
The HTTP request to 'https://notifications.cfapps.eu10.hana.ondemand.com/v2/Notification.svc/Notifications' failed with status code 403 (Forbidden) and response body '{"timestamp":"2022-11-24T14:58:26.069+00:00","status":403,"error":"Forbidden","path":"/v2/Notification.svc/Notifications"}'.

Do you have any suggestions?
Is it possible to see somewhere a more detailed log to understand the parameters used in the request by the Service Task?

Thanks in advance for answers,
Giampaolo

Accepted Solutions (0)

Answers (2)

Answers (2)

Giampaolo
Explorer
0 Kudos

Hi Tobias,
you are absolutely right and in fact I tried that approach, but there is a problem: the call to get the token supplies it but it fails, this also in postman and as reported in this post.

I tried this way yesterday, before writing this post, and I got this error:
The XSRF token request to URL 'https://notifications.cfapps.eu10.hana.ondemand.com/v2/Notification.svc/Notifications' failed with HTTP status code 501 (Not Implemented) and response body '<?xml version="1.0" ?><error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code></code><message xml:lang="en">Not implemented</message></error>'.

In the "Path to XSRF Token" field I put the url /v2/Notification.svc/Notification. If there was a URL to call to get the token without the response being an error, the Service Task would probably work fine.

Thanks and Best Regards,
Giampaolo

tobias_breyer
Contributor
0 Kudos

Hi Giampaolo,

Actually, I wondered why you do not use the "Path to XSRF Token" field. Then the service task retrieves the CSRF token for you and the same cookie (=session) is used for both requests. Also refer to this Guided Answer in the support portal https://ga.support.sap.com/dtp/viewer/index.html#/tree/2622/actions/36618:45397:37154:37155:40440

Did it not work for you?

Regards,

Tobias