Access denied in Ajax

1

I have this ajax

    $.ajax:{
        type:'GET',               
 url:"https://empresa1.sharepoint.com/teams/dev/plataforma1212/_api/web/lists/GetByTitle('Comprardores')/items",
                        async: false,
                        headers:{ 
                            "accept": "application/json",

                        },
                    }).done(function(response){
                        debugger
                    }).fail(function(response){
                        debugger
                        console.log("error");
                    }); 

Which should bring me a json from a list of SharePoint Online

But I get the following error

code
:
"-2147024891, System.UnauthorizedAccessException"
message
:
{lang: "es-ES",…}
lang
:
"es-ES"
value
:
"Acceso denegado. No tiene el permiso necesario para realizar esta acción o tener acceso a este recurso." 
mira el error

What could be causing this error?

    
asked by Eduard 14.06.2017 в 22:44
source

0 answers