Can we use Cisco based Custom web service in SharePoint-hosted app on Office 365?

My requirement is get items from Cisco based Custom web service and display items in SharePoint Environment (Office 365) using SharePoint Hosted app.

But its getting error Status code: 401,The remote server returned the following error while establishing a connection - 'Unauthorized'

Here is code:-

$(document).ready(function () {

    (function () {
        var context = SP.ClientContext.get_current();

        var request = new SP.WebRequestInfo();


        request.set_headers({ "Accept": "application/json;odata=verbose" });
        var response = SP.WebProxy.invoke(context, request);

        context.executeQueryAsync(successHandler, errorHandler);

        function successHandler() {
            if (response.get_statusCode() == 200) {
                // Load the OData source from the response.
                var responseData = JSON.parse(response.get_body());
                // log this to console so you can inspect it
            else {
                var errordesc = "Status code: " + response.get_statusCode();
                errordesc += "\n" + response.get_body();
               // console.log(errordesc)
                txtOutput.text = errordesc;
        function errorHandler() {
            txtOutput.text = 'Error';


How we provide the Network Credentials details for custom web service on SharePoint-hosted app development ?

1 Answer 1


You have to add a RemoteEndPoint to your solution. In the appmanifest, go to the tab 'Remote End Points'and write the url where you need to consume the information

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.