I want to create a simple webpage with a form that can create new items in a SharePoint list. I want to make this as a remote site that just connects to sharepoint.
Since I had a problem with REST API (it returned a 403 Forbidden exception), I decided to use SPServices to do it. When running this script:
var itemProperties = [["Title", $("#surname").val()], ["Data", $(".js-my-date").val()]];
$().SPServices({
operation: "UpdateListItems",
async: false,
batchCmd: "New",
webURL: 'https://mysite.sharepoint.com/sites/me/',
listName: 'ListNrOne',
valuepairs: itemProperties,
completefunc: function(xData, Status) {
if (xData.status === 200 && xData.statusText === "OK") {
$('#result').text("Row created with ID: " + $(xData.responseXML).SPFilterNode("z:row").attr("ows_ID") );
} else {
$('#result').text("It did not went well");
}
}
});
...I get 405 Method Not Allowed.
I tried it once inside an aspx file which I kept inside the SharePoint folder structure (it worked).
Now I'm trying from an html file uploaded to a remote site. I get 405 Method Not Allowed.
What is the problem? I have a hunch that it's all about priviliges or credentials, but I have no idea how to deal with it. Can anyone help me?