Skip to content

Batch update items in a list returns 400 error  #349

@AndersFreund

Description

@AndersFreund

I am using the script from the examples, adding my own site.
https://github.com/vgrem/Office365-REST-Python-Client/blob/master/examples/sharepoint/lists_and_items/update_items_batch.py

I can retrieve the list, and I can update items individualy, but the batch update fails.

Traceback (most recent call last):
  File "C:/projects/sharepoint API/Sharepoint API test.py", line 25, in <module>
    ctx.execute_batch()
  File "c:\repos\dev\office365-rest-python-client\office365\sharepoint\client_context.py", line 108, in execute_batch
    batch_request.execute_query()
  File "c:\repos\dev\office365-rest-python-client\office365\runtime\client_request.py", line 83, in execute_query
    self.process_response(response)
  File "c:\repos\dev\office365-rest-python-client\office365\runtime\odata\odata_batch_request.py", line 33, in process_response
    for response_info in self._read_response(response):
  File "c:\repos\dev\office365-rest-python-client\office365\runtime\odata\odata_batch_request.py", line 55, in _read_response
    yield self._deserialize_response(raw_response)
  File "c:\repos\dev\office365-rest-python-client\office365\runtime\odata\odata_batch_request.py", line 99, in _deserialize_response
    raise ValueError(response)
ValueError: HTTP/1.1 400 Bad Request
CONTENT-TYPE: application/xml;charset=utf-8

<?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code>-1, Microsoft.SharePoint.Client.InvalidClientQueryException</m:code><m:message xml:lang="en-US">Invalid request.</m:message></m:error>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions