【发布时间】:2020-05-16 04:38:06
【问题描述】:
我有一个要求,我需要从网页调用几个 SAP AIN(资产智能网络)API。我创建了一个网页,单击一个按钮,我想调用 SAP AIN API - 可以说是获取我在 AIN 中设置的设备数量。
SAP AIN 文档中提供的 API URL 是:
Application_URL/services/api/v1/equipment/$count
假设我的 AIN 应用程序 URL 是:
https://abcxyz.dispatcher.hana.ondemand.com/sites?hc_reset#Shell-home
我尝试了以下方法来形成 API URL:
https://abcxyz.dispatcher.hana.ondemand.com/services/api/v1/equipment/$count -- 没用
https://abcxyz.dispatcher.hana.ondemand.com/sites/services/api/v1/equipment/$count -- 没用
https://abcxyz.dispatcher.hana.ondemand.com/sites/services/api/v1/equipment/$count?content-type=application/json -- 没用
对于上述所有 URL,我收到 Internal 500 错误。
- 那么有什么方法可以形成 SAP AIN API URL?我究竟做错了什么 在这里?
- 另外,我如何通过基本身份验证,如用户名和密码 Javascript 中的 HttpRequest?
任何帮助都会很有用。
【问题讨论】:
标签: rest api sap sap-cloud-platform