cancel
Showing results for 
Search instead for 
Did you mean: 

404 error while calling SAP Build Work Zone(Launchpad) Notification API in BAS

Vikas-Kumar
Discoverer
0 Kudos

Hello Experts,

I am calling Notification api using ajax call in SAPUI5 BAS to push notification to SAP build work zone(Launchpad site) but I am getting 404 error in the network. Even I am getting same error after deploying the app to cloud foundary.

I have done steps below.

1. Created destination in BTP

2. Configured route in xs-app.json

Do I need to upadate something in mta.yaml to work?

Code in SAPUI5

var appId = this.getOwnerComponent().getManifestEntry("/sap.app/id");
var appPath = appId.replaceAll(".""/");
var appModulePath = jQuery.sap.getModulePath(appPath);
var xsrfUrl =  appModulePath + "/Notify/v2/Notification.svc/Notifications";
 $.ajax({
                    url: xsrfUrl,
                    headers: {
                        "X-CSRF-Token": "fetch"
                    },
                    async: false,
                    type: "GET",
                    success: function (oDatastatusxhr) {
                    },
                    error: function (oError) {
                    }
                });
I want to fetch token from this URL to do post call for a notification.

Can you please give me solution/suggestions?

Thanks in advance!

Note: The same url is working in Postman. I am able to push notifications to launchpad

Best Regards,

Vikas Kumar

SAPUI5  SAP BTP, Kyma runtime  SAP Fiori Launchpad OData  @sapsupportdig @BTPDev @SAPSupport 

Destination in BTP

VikasKumar_0-1713272596623.png

VikasKumar_0-1713274788559.png

Route in xs-app.json

VikasKumar_6-1713273661394.png

Error

VikasKumar_5-1713273629720.png

Accepted Solutions (0)

Answers (0)