I have an requirement to fetch the data from API present in the on-Prem server and display it in an SharePoint Online Page. Sample URL: https://myserver.net/api/issue-number/ OUTPUT in JSON format: {“OPEN ISSUE”: 1000, “CREATED ISSUE”: 230, “CLOSED ISSUE”: 260} Accessing the URL in the browser displays the output in JSON format. I tried using JSNOP but unable to get the data. Can someone tell me how can achieve this?
Is there any security required around this? Are you able to hit the sample URL because the API is your network? Frankly, I try to stay away from JSONP, it’s more so a patch than a real security mechanism for Cross Domain Calls.
If the api is available publicly, you shouldn’t have any issues. However, if it’s on-premise and you need authentication, you’ll need to do a bit of work in Azure as well as on the API for securely accessing the content.
See my post here. This is how you secure a WebAPI on-premise and access it via the browser.
http://www.aerieconsulting.com/blog/serve-on-premise-content-to-sharepoint-online-with-webapi
If your API is publically accessible,could you provide any error details that go along with it?