6
votes
REST API with HTTP in Sharepoint Online
I created a small example for you to use.
This example forwards your request to the requested endpoint http://api.promasters.net.br/cotacao/v1/valores/
If you pass which resource you want to reach ...
4
votes
Accepted
How to change view SharePoint (2010,2013) list REST API
The views can be created for a list with manual steps by going through the list settings. The same can be implemented programmatically using several methods. In this article, you will learn how it can ...
4
votes
Accepted
update sharepoint list using jQuery and ajax
How to update List Item via SharePoint REST interface
function updateJson(endpointUri,payload, success, error)
{
$.ajax({
url: endpointUri,
type: "POST",
data: ...
3
votes
Accepted
How to use SharePoint REST Api in an application that is hosted outside of SharePoint
Finally got it working. Below is the AJAX call to sharepoint. I am using the SharePoint 2013 server with AD authentication
function readSPRestApi()
{
$.support.cors = true;
...
3
votes
Accepted
REST: Update person field with email as input
For getting the ID based on the user's email address, you can try to query like below -
https://<site>/_api/Web/lists/getbytitle('User Information List')/Items?$filter=EMail eq 'email id goes ...
3
votes
Accepted
Retrieve data.d.results after REST query
To extract data.d.results you can use for loop as the following:
for (var i = 0; i < data.d.results.length; i++)
{
var item = data.d.results[i];
console.log(item.Title);
...
3
votes
Accepted
How to call custom web part's method in Ajax call?
Instead of defining your WebMethod in WebPart, create an application page and define the WebMethod in that application page. Use the application page URL like /_layouts/YourSolution/ApplicationPage....
3
votes
Accepted
SharePoint Framework jQuery REST POST returns 400 Bad Request error
Update
Thanks to @wjervis for pointing out.
To update list item using REST API, the endpoint would be as below:
https://[site URL]/_api/web/lists/GetByTitle('List Title')/items(ID)
where ID = ...
3
votes
Accepted
CAML Query vs Odata Query string operators
A few benefits of REST ODATA queries:
Much easier to write.
Generally more readable and obvious to another developer.
Might be a tiny bit faster, but probably not enough to notice. (The ODATA query ...
3
votes
Accepted
403 on /_api/web/webs if I don't have access to 1 subsite out of many
/_api/web/webs only works for users who have manage web or above permissions on the site collection i.e you need to be either a site collection owner or Site collection admin for this endpoint to work....
3
votes
Get value from Column and cut the duplicates using SharePoint Rest API
While Joe McShea is correct in that there is no direct "distinct" type of operation through the REST API, as I learned in the answer I accepted to a question I had over on S.O., you can get distinct ...
2
votes
Accepted
jQuery Ajax calls failing with validation invalid or corrupted
The __REQUESTDIGEST hidden field is not available in the SharePoint Framework which is why your request is failing. Instead of trying to retrieve it from the page, you should retrieve it from ...
2
votes
How to update Values in Sharepoint list using ajax
function CreateListItemWithDetails(listName, webUrl, newItemTitle, success, failure) {
var itemType = GetItemTypeForListName(listName);
var item = {
"__metadata": { "type": itemType },
...
2
votes
Accepted
Error : "The 'Access-Control-Allow-Origin' header contains multiple values" while enabling CORS in SharePoint 2013
Finally got the answer to this
For this we have to disable the "Request Management" service on the SharePoint server. Following are the steps to do it.
Go to
Central Admin-->Application Management--...
2
votes
Accepted
Excel web part vs rest api
The images will be static, but that sounds like what you want. For SharePoint Online, you will have to use the Graph API instead.
https://docs.microsoft.com/en-us/sharepoint/dev/general-development/...
2
votes
Accepted
Execute ajax foreach element in array
I've only done this in SP 2013 on-prem. So there may be slight differences. First thing I notice is that in your array of recipients you've got both double and single quotes. So that probably isn't ...
2
votes
Accepted
Populate Specific items of the SharePoint Online List using Java webservice when a Drop-down column is selected while creating a new item
Option 1 :You can attach a JSLink to your fields and in that javascript you can write js code to call your Java webservice and auto populate other field value.
below are few code samples available ...
2
votes
Accepted
Context.ExecuteQueryAsync not trigerring
Ensure the item(file) is checked out before updating.
You can print the error details using error handler as demonstrated below:
$.ajax({
url: siteurl + "/_api/web/lists/getbytitle('" + ...
2
votes
Accepted
Attachment File using REST was failed to upload with the problem of SP.RequestExecutor.js
You have used SP.RequestExecutor which is used for making cross domain calls and if so your _spPageContextInfo.webServerRelativeUrl won't work.
Either you need to use query string to get the url or ...
2
votes
Accepted
Is it posible to upload file in Lists Attachments in SharePoint in custom way
If you want to upload file to list attachment it has to be associated with list item. Change your url as below :
var queryUrl = serverUrl+ "/_api/lists/GetByTitle('" + serverRelativeUrlToFolder + "')...
2
votes
Accepted
SharePoint date field value using jQuery
The input value can be got with Jquery:
var test=$("input[title='Date']").val();
And you could trace the value change for this date field control in the new form like this:
<script src="https://...
2
votes
Accepted
How to change null value to empty using REST
You can use it as value.Department ? value.Department : "" which is a JS ternary operator.
Basically it acts like an if condition as below:
if(value.Department){
value.Department = value....
2
votes
Accepted
Look Up value through REST without select or expand
You can use the RenderListDataAsStream endpoint to fetch lookup values without using select or expand. This works for User fields as well as Managed metadata columns as well.
Try with the below ...
2
votes
Get value from Column and cut the duplicates using SharePoint Rest API
No, SharePoint REST/OData has no equivalent select distinct. You can only achieve this by post-processing.
Ref: How to get distinct values using Rest Api and bind to html dropdown
2
votes
Asking credential popup on sharepoint 2013 public facing site
Did you enable anonymous access for the list? To access the page anonymously, you need to make sure the list also could be accessed for anonymous users.
2
votes
Accepted
How to insert selected Checkboxes via Sharepoint 2016 API
While harshal's answer is on the right track, there is a problem in the code posted there (at least at the time of my writing this). But maybe it would help to understand a bit more what is going on.
...
2
votes
Accepted
Creating folder in SharePoint Library using Rest API
You need to use the Folders endpoint something like below:
_spPageContextInfo.siteAbsoluteUrl + "/_api/Web/Folders/add('Communications/NewFolderName')"
Note: You need to pass the ServerRelativeUrl ...
2
votes
running multiple ajax calls synchrnously in SharePoint rest api
Since you are using jQuery, you can use the jQuery Deferred object, which is similar to a regular javascript Promise, in order to control the execution flow of your multiple requests. What you need ...
2
votes
Accepted
Rest api returns undefined
The REST API endpoint /items(<itemId>) returns the list item data in data.d and not in data.d.results.
So, try changing your success function like this:
success: function (data) {
console....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
jquery-ajax × 88sharepoint-online × 37
sharepoint-rest-api × 37
javascript × 22
jquery × 12
sharepoint-enterprise × 10
sharepoint-server × 10
sharepoint-designer × 9
rest × 9
ajax × 9
development × 3
sharepoint-foundation × 3
spfx × 3
caml-query × 3
jsom × 3
2013 × 2
2010 × 2
list × 2
office-365 × 2
sharepoint-addin × 2
csom × 2
html × 2
content-editor-web-part × 2
api × 2
wcf × 2