Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 1.35 KB

InternetAPIwithBasicAuthentication.md

File metadata and controls

35 lines (27 loc) · 1.35 KB

CDS-SCP-API Node Module Example

SAP Cloud Platform Internet Destinations with Basic Authentication

This example uses APIs of the SAP Gateway Demo System ES5. If you don't have access to the SAP Gateway Demo System ES5, you can follow this tutorial to get access.

Basic Authentication Examples

Destination Configuration in SAP Cloud Platform Destination Service

Destination Configuration

Javascript/Node.js Code

const cdsapi = require("@sapmentors/cds-scp-api");

async function InternetAPIGetRequestwithBasicAuthentication() {
	const service = await cdsapi.connect.to("ES5");
	return await service.run({
		url: "/sap/opu/odata/sap/EPM_REF_APPS_SHOP_SRV/Products?$top=2"
	})
}
	
InternetAPIGetRequestwithBasicAuthentication()
	.then((data) => {
		console.log(data.d.results[0].Name)
	})

Output Javascript/Node.js Code

'Notebook Basic 15'