Update List Items using REST API - Keep Getting 400 Bad Request

I am using code from the following answer:
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/40833576-5853-4ca4-95cf-b5b1d69f465f/sharepoint-rest-and-c-sample-to-update-list-item?forum=sharepointdevelopment
I am having a tough time figuring out the issue though.  I have been able to retrieve list items, but now I want to update those items.  This is the following code just to get the digest information with passing in credentials:
public static string GetFormDigest(System.Net.NetworkCredential cred)
string formDigest = null;
string resourceUrl = "https://SITEURL/_api/contextinfo";
HttpWebRequest wreq = HttpWebRequest.Create(resourceUrl) as HttpWebRequest;
wreq.Credentials = cred;
wreq.Method = "POST";
wreq.Accept = "application/json;odata=verbose";
wreq.ContentLength = 0;
wreq.ContentType = "application/json";
string result;
WebResponse wresp = wreq.GetResponse();
using (StreamReader sr = new StreamReader(wresp.GetResponseStream()))
result = sr.ReadToEnd();
var jss = new JavaScriptSerializer();
var val = jss.Deserialize<Dictionary<string, object>>(result);
var d = val["d"] as Dictionary<string, object>;
var wi = d["GetContextWebInformation"] as Dictionary<string, object>;
formDigest = wi["FormDigestValue"].ToString();
Console.WriteLine(formDigest);
return formDigest;
Then the following code is used:
string result = string.Empty;
Uri uri = new Uri(sharepointUrl.ToString() + "/_api/Web/lists/getByTitle('DemoList')/items(1)");
HttpWebRequest wreq = (HttpWebRequest)WebRequest.Create(uri);
wreq.Credentials = cred;
wreq.Method = "POST";
wreq.Accept = "application/json; odata=verbose";
wreq.ContentType = "application/json; odata=verbose";
wreq.Headers.Add( "X-HTTP-Method","MERGE");
wreq.Headers.Add( "IF-MATCH", "*");
wreq.Headers.Add("X-RequestDigest", GetFormDigest(cred));
string stringData = "{'__metadata': { 'type': 'SP.Data.DemoListListItem' }, 'Title': 'updated!'}";
wreq.ContentLength = stringData.Length;
StreamWriter writer = new StreamWriter(wreq.GetRequestStream());
writer.Write(stringData);
writer.Flush();
try {
WebResponse wresp2 = wreq.GetResponse();
using (StreamReader sr = new StreamReader(wresp2.GetResponseStream()))
result = sr.ReadToEnd();
catch (Exception e) { Console.WriteLine("An error occurred: '{0}'", e); }
It errors out when it tries to send the command to Sharepoint.  I am NOT using a sharepoint hosted app.  I just wanted to directly contact sharepoint and update items.  Any help or suggestions would be greatly appreciated!
Thanks,
Priyank
 

I just found some other code that seemed to work on editing a title and edited it kind of guessing it would work and it did!
This is the code that ended working using the same digest code from above:
Console.WriteLine("\n Newer Fancier Code \n");
Uri uri = new Uri("https://SHAREPOINTURL/_api/web/lists/GetByTitle('Demo')/items(1)");
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.ContentType = "application/json;odata=verbose";
request.Headers["X-RequestDigest"] = GetFormDigest(cred);
request.Headers["X-HTTP-Method"] = "MERGE";
request.Headers["IF-MATCH"] = "*";
request.Credentials = cred;
request.Accept = "application/json;odata=verbose";
request.Method = "POST";
string stringData = "{ '__metadata': { 'type': 'SP.ListItem' }, 'Location': 'updatedinfo' }";
request.ContentLength = stringData.Length;
StreamWriter writer = new StreamWriter(request.GetRequestStream());
writer.Write(stringData);
writer.Flush();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
Just fyi if anyone was wondering.  Next, I'm going to be trying to update multiple fields, possibly multiple items if possible if anyone knows how to do that.

Similar Messages

  • How to update 500 list items using Rest API

    Hi All,
    i have requirement that is "required to update 500 list items using rest Api".
    how can i do it,please share your thoughts with me.
    Thanks,
    Madhu.

    Didn't get you correctly, if you asking reference for REST API to update list items please refer below links
    http://msdn.microsoft.com/en-us/library/office/jj164022(v=office.15).aspx
    Destin -MCPD: SharePoint Developer 2010, MCTS:SharePoint 2007 Application Development

  • Create List Item using REST API

    Hi All
      I try create list item using REST in SharePoint 2013.  when code is try add new item in list , getting error :
    A node of type 'EndOfInput' was read from the JSON reader when trying to read the start of an entry. A 'StartObject' node was expected.
    Please help me
    function addData() {
    var title = $('#txtTitile').val();
    //alert(title);
    var items = {
    __metadata: { "Type": "SP.Data.OrderDetailsListItem"},
    Title:title
    var exec = new SP.RequestExecutor(appweburl);
    exec.executeAsync(
    url: appweburl + "/_api/SP.AppContextSite(@target)/web/lists/getbytitle('OrderDetails')/Items?@target='" + hostweburl + "'",
    method: "POST",
    data: JSON.stringify(items),
    headers: {
    Accept: "application/json;odata=verbose",
    "Content-Type": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val()
    success: function (data) { alert(JSON.parse(data)); },
    error: function (error)
    { alert(JSON.stringify(error)); }
    with Regards Sivam

    Hi,                                                             
    Here is a demo which works in my environment for your reference:
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function()
    $("#Button1").click(function(){
    createListItemWithDetails("list2", "http://sp2013sps", "item1");
    // Getting the item type for the list
    function GetItemTypeForListName(name) {
    //alert("GetItemTypeForListName: "+name);
    return"SP.Data." + name.charAt(0).toUpperCase() + name.slice(1) + "ListItem";
    // CREATE Operation
    // listName: The name of the list you want to get items from
    // siteurl: The url of the site that the list is in. // title: The value of the title field for the new item
    // success: The function to execute if the call is sucesfull
    // failure: The function to execute if the call fails
    function createListItemWithDetails(listName, siteUrl, title) {
    var itemType = GetItemTypeForListName(listName);
    //alert("itemType :"+itemType);
    var item = {
    "__metadata": { "type": itemType },
    "Title": title
    $.ajax({
    url: siteUrl + "/_api/web/lists/getbytitle('" + listName + "')/items",
    type: "POST",
    contentType: "application/json;odata=verbose",
    data: JSON.stringify(item),
    headers: {
    "Accept": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val()
    success: function (data) {
    location.href=location.href;
    //success(data);
    error: function (data) {
    alert("error");
    //failure(data);
    </script>
    <input id="Button1" type="button" value="Run Code"/>
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to update list item using client object model without changing created/modified dates?

    Hello All,
    I want to update list item using the SharePoint Client Object
    Model without updating the created / modified date. Is it possible?
    Please help.
    Thanks.

    Using the SystemUpdate method should do the trick, according
    to its literature.
    Additionally, would something like this be of any use for you?  Taken from this
    Stack Exchange thread: -
    public static class SPListItemExtensions
    /// <summary>
    /// Provides ability to update list item without firing event receiver.
    /// </summary>
    /// <param name="item"></param>
    /// <param name="doNotFireEvents">Disables firing event receiver while updating item.</param>
    public static void Update(this SPListItem item, bool doNotFireEvents)
    SPItemEventReceiverHandling rh = new SPItemEventReceiverHandling();
    if (doNotFireEvents)
    try
    rh.DisableEventFiring();
    item.Update();
    finally
    rh.EnableEventFiring();
    else
    item.Update();
    /// <summary>
    /// Provides ability to update list item without firing event receiver.
    /// </summary>
    /// <param name="item"></param>
    /// <param name="incrementListItemVersion"></param>
    /// <param name="doNotFireEvents">Disables firing event receiver while updating item.</param>
    public static void SystemUpdate(this SPListItem item, bool incrementListItemVersion, bool doNotFireEvents)
    SPItemEventReceiverHandling rh = new SPItemEventReceiverHandling();
    if (doNotFireEvents)
    try
    rh.DisableEventFiring();
    item.SystemUpdate(incrementListItemVersion);
    finally
    rh.EnableEventFiring();
    else
    item.SystemUpdate(incrementListItemVersion);
    /// <summary>
    /// Provides ability to update list item without firing event receiver.
    /// </summary>
    /// <param name="item"></param>
    /// <param name="doNotFireEvents">Disables firing event receiver while updating item.</param>
    public static void SystemUpdate(this SPListItem item, bool doNotFireEvents)
    SPItemEventReceiverHandling rh = new SPItemEventReceiverHandling();
    if (doNotFireEvents)
    try
    rh.DisableEventFiring();
    item.SystemUpdate();
    finally
    rh.EnableEventFiring();
    else
    item.SystemUpdate();
    private class SPItemEventReceiverHandling : SPItemEventReceiver
    public SPItemEventReceiverHandling() { }
    new public void DisableEventFiring()
    base.DisableEventFiring();
    new public void EnableEventFiring()
    base.EnableEventFiring();
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Tutorial on how to update list items using ListData.svc

    Can you please point me to a tutorial which shows how to update a list item using listdata.svc and C#?
    Sorry if this is FAQ.
    I have found articles on read list... but I haven't found anything on update a list item.
    val it: unit=()

    when i try this I get an error 500
    I created an ASP.NET web application that allows the user to modify data that is stored in SharePoint I rather not go into the reasons why this application was created but focus more on why doesn't the listdata.svc allow me to update a task item that was
    created by a workflow collect data from user action.
    1. The workflow creates the item.
    I collect the item and update the item using the below code. This is not an OOTB approval workflow that is just the name I used. When I get to save changes I received the following error code.
    Dim getApprovalItem As ExpenseApprovalRuleBasedTasksItem = spContext.ExpenseApprovalRuleBasedTasks.Where(Function(i) i.Id = Pam.ApprovalItemID).FirstOrDefault
    If String.IsNullOrEmpty(getApprovalItem.AuditorApprovalValue) Then
    getApprovalItem.AuditingComments = approvalComments
    Select Case approvalDecision
    Case "Approved"
    getApprovalItem.AuditorApproval = ExpenseApprovalRuleBasedTasksAuditorApprovalValue.CreateExpenseApprovalRuleBasedTasksAuditorApprovalValue("Approved")
    getApprovalItem.AuditorApprovalValue = "Approved"
    Case "Rejected"
    getApprovalItem.AuditorApproval = ExpenseApprovalRuleBasedTasksAuditorApprovalValue.CreateExpenseApprovalRuleBasedTasksAuditorApprovalValue("Rejected")
    getApprovalItem.AuditorApprovalValue = "Rejected"
    End Select
    getApprovalItem.Outcome = "Completed"
    getApprovalItem.Status = ExpenseApprovalRuleBasedTasksStatusValue.CreateExpenseApprovalRuleBasedTasksStatusValue("Completed")
    getApprovalItem.StatusValue = "Completed"
    getApprovalItem.Complete = True
    spContext.UpdateObject(getApprovalItem)
    spContext.SaveChanges()
    End If

  • Program work before, without change but now web service get 400 bad request

    i wrote a program to get data by java, using axis library, but recently, the program cannot access the data.
    And it return a 400 bad request.
    i tried to cap the header and context send out,result as below,
    Content-Type=text/xml; charset=UTF-8
    SOAPAction="document/urn:crmondemand/ws/user/10/2004:UserQueryPage"
    User-Agent=Axis2
    Host=(server address)
    Transfer-Encoding=chunked
    context
    <?xml version="1.0" encoding="UTF-8" ?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <ns2:UserWS_UserQueryPage_Input xmlns:ns2="urn:crmondemand/ws/user/10/2004">
    <ns2:UseChildAnd>false</ns2:UseChildAnd>
    <ns2:PageSize>100</ns2:PageSize>
    <ListOfUser xmlns="urn:/crmondemand/xml/user">
    <User>
    <UserId />
    <Alias />
    <EMailAddr />
    <FirstName />
    <LastName />
    </User>
    </ListOfUser>
    <ns2:StartRowNum>0</ns2:StartRowNum>
    </ns2:UserWS_UserQueryPage_Input>
    </soapenv:Body>
    </soapenv:Envelope>
    other http request information cap:
    getAuthType= null
    getCharacterEncoding= UTF-8
    getContentLength= -1
    getContentType= text/xml; charset=UTF-8
    getCookies= null
    getLocale= zh_HK
    getMethod= POST
    getPathInfo= null
    getProtocol= HTTP/1.1
    getQueryString= null
    getRemoteUser= null
    getRequestURI= /Integration
    getRequestURL= http://(server address and port)/Integration (https for real case, but to cap using http)
    getServletPath= /Integration
    getUserPrincipal= null
    i cannot find out the reason to make the program not work, as i have not change any code and library
    Edited by: user6642894 on 2009/3/23 上午 1:24
    Edited by: paddy_yeung on 2009/3/23 下午 8:33

    Check the security mode, it should be “TransportCredentialOnly” and the clientCredentialType “NTLM” as shown in the blog post
    http://blogs.msdn.com/b/kaevans/archive/2009/03/10/calling-sharepoint-lists-web-service-using-wcf.aspx
    The other option is to add the service as
    Web Reference and not as Service Reference.
    In your ‘Add Service Reference’ window, click on ‘Advanced’ and choose ‘Add Web Reference’ – I prefer this for ASMX web services which makes it much easier.

  • Getting 400 Bad Request response from Beehive SOAP API

    Hi,
    I'm trying to consume beehive web services via SOAP, more specifically I'm trying to upload a file into a workspace however at this point of the implementation I'm stuck getting 400 responses from the server.
    I'm trying to upload a file using the createDocument() method that's located on the contentManagementService, indeed in the line that I call to that method is in which my app stops and returns the exception of error 400
    I'm attaching a sample of the message I'm sending, at this point I understand every parameter that it's being sent except for the contentStreamId parameter, I don't know what it means, the documentation doesn't explain it either.
    Does anyone has an idea of what's that paremeter for and how to use it properly?
    Here's a sample of code I'm using:
    // add new document
    String str = "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r" +
    "Test body.Test body.Test body.Test body.Test body.Test body.\r";
    byte[] docContent = str.getBytes("UTF8");
    DocumentCreator docCreator = new DocumentCreator();
    docCreator.setConflictResolutionMode(ConflictResolutionMode.OVERWRITE);
    docCreator.setName("File" + System.currentTimeMillis()%10000 + ".txt");
    docCreator.setParent(teamWksp.getDefaultDocumentsFolder().getCollabId());
    IdentifiableSimpleContentUpdater iscu = new IdentifiableSimpleContentUpdater();
    iscu.setContentStreamId(docContent.toString());
    DocumentUpdater docUpdater = new DocumentUpdater();
    docUpdater.setContentUpdater(iscu);
    docCreator.setUpdater(docUpdater);
    Document doc = contentMgmtServiceSoap.createDocument(docCreator, docContent,projFull);
    here's the message being sent:
    <S:Envelope>
         <S:Body>
              <ns3:createDocument>
                   <creator>
                        <ns2:conflictResolutionMode>OVERWRITE</ns2:conflictResolutionMode>
                        <ns2:name>File8692.txt</ns2:name>
                        <ns2:parent>
                             <ns2:id>334B:3BF0:afrh:38893C00F42F38A1E0404498C8A6612B00023FF3F175</ns2:id>
                             <ns2:resourceType>afrh</ns2:resourceType>
                        </ns2:parent>
                        <ns2:updater>
                             <ns2:contentUpdater xsi:type="ns2:identifiableSimpleContentUpdater">
                                  <ns2:contentStreamId>[B@70751932</ns2:contentStreamId>
                             </ns2:contentUpdater>
                        </ns2:updater>
                   </creator>
                   <dhandler>VGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuDVRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5Lg1UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS4NVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuDVRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5Lg1UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS4NVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuDVRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5Lg1UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS4NVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuDVRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5Lg1UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS4NVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuDVRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5Lg1UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS4NVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuDVRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5Lg1UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS5UZXN0IGJvZHkuVGVzdCBib2R5LlRlc3QgYm9keS4N</dhandler>
                   <projection value="FULL" xsi:type="ns2:projection"/>
              </ns3:createDocument>
         </S:Body>
    </S:Envelope>

    Did you manage to successfully upload the file? If you did, please give solution.
    Thanks

  • When signing in to comment on huffpost article I now get 400 bad request, header or cookie too large, nginx; won't let me comment. How fix?

    see sentence

    This can be caused by corrupted cookies or cookies that are blocked (check the permissions on the about:permissions page).
    Clear the cache and cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"

  • Update item in list using rest api - failed when browsing in juniper session

    this issue is about browsing to an on premises sharepoint 2013 inside a LAN using Juniper session
    the user can see everything and can create new list items with rest api but
    cannot update existing items using the function below.
    we've got this function which we use to update list items in rest
    it works like a charm when browsing inside the LAN
    function updateListItem(itemIdentityField, itemIdentity, listName, siteUrl, item, success, failure) {
    getListItemWithId(itemIdentityField, itemIdentity, listName, siteUrl, function (data) {
    $.ajax({
    url: data.__metadata.uri,
    type: "POST",
    contentType: "application/json;odata=verbose",
    data: JSON.stringify(item),
    headers: {
    "Accept": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val(),
    "X-HTTP-Method": "MERGE",
    "If-Match": data.__metadata.etag
    success: function (data) { success(data, callBackIndex, null) },
    error: function (data) {
    getError(data);
    }, function (data) {
    failure(data);
    the error i get in ULS log is:
    Original error: Microsoft.SharePoint.Client.InvalidClientQueryException: The parameter __metadata does not exist in method GetItemByStringId.
    at Microsoft.SharePoint.Client.MethodInformation.GetParameter(String parameterName)
    at Microsoft.SharePoint.Client.ClientCallableEdmModelBuilder.CreateFunctionImportForMethodBodyParser(MethodInformation clientMethod, List`1 parameterNames, ProxyContext proxyContext)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ParseParametersFromBody(MethodInformation methodInfo, Boolean allowPostBodyAccess, Boolean isLeafSegment, ClientValueCollection args)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ParseParametersFromBodyOrQueryString(MethodInformation methodInfo, Boolean allowPostBodyAccess, Boolean isLeafSegment, ClientValueCollection args)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.CreateMethodArgumentsUsingNamedParameters(MethodInformation methodInfo, IList`1 parameterList, Boolean isLeafSegment, Boolean allowPostBodyAccess)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.InvokeMethod(Boolean mainRequestPath, Object value, ServerStub serverProxy, EdmParserNode node, Boolean resourceEndpoint, MethodInformation methodInfo, Boolean isExtensionMethod, Boolean isIndexerMethod)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPathMember(Boolean mainRequestPath, String path, Object value, EdmParserNode node, Boolean resourceEndpoint, MethodInformation& methodInfo)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPath(Boolean mainRequestPath, String path, String pathForErrorMessage)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.Process()
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ProcessRequest()
    at Microsoft.SharePoint.Client.Rest.RestService.ProcessQuery(Stream inputStream, IList`1 pendingDisposableContainer)
    Any help?
    Somebody?
    Thanks

    Hi patrik
    Really appreciate your replying.
    Could you try and refer to the issues below:
     this error occurs even with site collection administrator (i tested it with three different
    users)
    there isnt any difference between items in list - all have same permissions
    it occurs in several lists in site (all lists have same permissions)
    if browsing inside the LAN everything works just fine
    updating from the UI works fine in all means
    It really seems like a Rest related problem(is there anyone from the Microsoft REST team who can take look at this error?)
    Thanks
    Hushay

  • Using REST API: Query search box to return list items

    Hey,
    My goal is to create a search box which returns the items (matching to the name) from a list.
    Bonus: The return would happen without requiring user to click a
    Search button or such.
    To achieve this I assume the SharePoint 2013's REST API should be used. I'm completely inexperienced in using the REST API so all kind of suggestions are available.

    Hi,
    Here are some articles about SharePoint 2013 REST API for your reference:
    Get started with the SharePoint 2013 REST service
    http://msdn.microsoft.com/en-us/library/office/fp142380(v=office.15).aspx
    How to: Complete basic operations using SharePoint 2013 REST endpoints
    http://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    SharePoint 2013 – CRUD on List Items Using REST Services & jQuery
    http://www.plusconsulting.com/blog/2013/05/crud-on-list-items-using-rest-services-jquery/
    Working with SharePoint list data - OData, REST and JavaScript
    http://blogs.technet.com/b/fromthefield/archive/2013/09/05/working-with-sharepoint-list-data-odata-rest-and-javascript.aspx
    Best regards
    Dennis Guo
    TechNet Community Support

  • Add Item using REST and populate People field (SharePoint 2010)

    I am trying to add an item to a list that has a People type field using REST API.  For some reason, I am getting 400 (Bad Request) error.  Can anyone show me how to add a list item and populate the user field?
    Here's the code snippet I am using -
    var url = 'https://mytestsite/_vti_bin/listdata.svc/mylist';
    var item = {};
    item.Title = 'my REST item';
    item.User = 'contoso\user1';
    var jsonObj = Sys.Serialization.JavaScriptSerializer.serialize(item);
    $.ajax({
             type: 'POST',
             url: url,
             contentType: 'application/json',
             processData: false,
             data: jsonObj,
             success: function ()
               console.log('item updated');
    Thanks!

    Hi,
    To update the People field, we will need to make a reference to the user information list.
    Here are two links will provide more information:
    http://sharepoint.stackexchange.com/questions/65650/rest-api-update-a-muli-value-user-field
    http://charliedigital.com/2011/04/23/updating-user-fields-via-listdata-svc/
    You can view the User Information list in this way:
    http://zimmergren.net/technical/sharepoints-hidden-user-list-user-information-list
    Best regards
    Patrick Liang
    TechNet Community Support

  • Using REST API to promote Document Properties into SharePoint document library

    Hi,
    Is it possible to extract Document properties of a file and update library column using REST API?
    Thanks,
    techie

    Hi,
    We can use the following REST endpoint to get document property:
    http://site/_api/web/getfilebyserverrelativeurl('/Shared Documents/filename.docx')/<property name>
    https://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx#bk_File
    If you want to update document library column, the following blog for your reference:
    Updating SharePoint List items with SharePoint’s REST API in JavaScript
    http://community.rightpoint.com/blogs/viewpoint/archive/2014/10/23/updating-sharepoint-list-items-with-sharepoint-s-rest-api-in-javascript.aspx
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Reading list items using JQeury

    Hi All,
    I am new to JQuery. Please help me on reading the ListItems(for eg., title, name, location etc.,) using JQeury & wanted to display this data in a site page.
    Let me know if you have any queries.
    Thanks,
    Kumar.

    check this article on using REST and Jquery to get list items
    http://www.plusconsulting.com/blog/2013/05/crud-on-list-items-using-rest-services-jquery/
    you can use JSOM as well
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/8dda0580-c632-4c1b-92f0-59e1a3f29e5b/jquery-fetch-data-from-sharepoint-list-in-a-webpart
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • I get a bad request message when trying to open my mail in Yahoo.

    I keep getting a "bad request" message when trying to open my mail in Yahoo.

    This issue can be caused by corrupted cookies.
    * "Clear the Cache": Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Firefox > Preferences > Privacy > Cookies: "Show Cookies"
    If clearing the cookies doesn't help then it is possible that the file <i>cookies.sqlite</i> that stores the cookies is corrupted.
    Rename (or delete) <b>cookies.sqlite</b> (cookies.sqlite.old) and delete <b>cookies.sqlite-journal</b> and <b>cookies.txt</b>, if they exist, in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder] in case the file cookies.sqlite got corrupted.
    * http://kb.mozillazine.org/Cookies#Removing_cookies

  • Getting a Bad Request Error upn logging into website - Safari goes right in

    Trying to access South Carolina Library information for students at an educational institution. When we get to the login page for the place we need to go, Firefox comes back with a 400 Bad Request Error. If the students use Safari, it goes right through. I prefer them to use one browser and would prefer Firefox. Any thoughts? Narrowing it down, it has something to do with networking and Firefox. I can log on as a local admin on the MAC and Firefox will go right through, but if the students log into to the MAC using Open Directory, I get the Bad Request message.

    Trying to access South Carolina Library information for students at an educational institution. When we get to the login page for the place we need to go, Firefox comes back with a 400 Bad Request Error. If the students use Safari, it goes right through. I prefer them to use one browser and would prefer Firefox. Any thoughts? Narrowing it down, it has something to do with networking and Firefox. I can log on as a local admin on the MAC and Firefox will go right through, but if the students log into to the MAC using Open Directory, I get the Bad Request message.

Maybe you are looking for

  • How to print an Doc file(MS Word File)on a printer in JAVA

    Hi.I am Prakash. Folowing is the code that i have used to print an doc file on a printer. Problem is that , when i run this code it will provide me an printout of a doc file.,but not in well formate as the actual formate of the file. If any one tried

  • How to display multiple signals on the same chart/graph

    Hello, I have a text file that has 21 different signals acquired through NI DAQ. I am able to read the file and display on the chart but the problem is all the signals have the same dynamic range -6 to +6 so when plotted they all show up on top of ea

  • Instrument I/O assistant configuration dialog box does not appear

    Hello, In the function pallette both input and output subpallettes have instrument assistant express vi.But, when I put in the block diagram window Instr I/O assistant configuration dialog box doesnot appear.I double clicked instr assistant icon but

  • Can anyone give me the Address that goes in the top address bar of Aurora.

    It has taken me days to find a way of contacting someone at Firefox to help an avid fan (Me) to get this far so I really hope you can help me. I downloaded Firefox Aurora about 10 days ago but had a problem with my PC so I reformatted the drive "C" b

  • Equipment Master

    Hi, client has same naming convention for asset as well as Equipemnt Master.bec equipment is nothing but a asset.instead of putting asset no in equipemnt master,He just want to capture/fetch Equipment master no in sap for plant maintenance as Asset i