1

I use the REST API to create list item, upload file linked to this item and update the item. For some list everything works fine and I can realize all these operations but for some other lists on the same site the creation is ok but the upload and update fail with a SPListDataValidationException. I check that no validation is applied to the fields of the list.

Here find an extract of the send request to update a field of the list :

POST https://<my_site_address>/_api/web/lists/getbytitle('Demandes%20de%20travaux')/items(20722) HTTP/1.1
Host: <my_host>
User-Agent: python-requests/2.21.0
Accept-Encoding: gzip, deflate
Accept: application/json; odata=verbose
Connection: keep-alive
Content-Type: application/json; odata=verbose
Cookie: FedAuth= <the FedAuth>
x-requestdigest: <the X-requestdigest>
X-HTTP-Method: PATCH
IF-MATCH: "1"
Content-Length: 79

{"__metadata": {"type": "SP.Data.DemandeSIListItem"}, "Nom_x0020_usuelId": 863}

and an extract of the response coming from the site :

HTTP/1.1 500 Internal Server Error
Cache-Control: private, max-age=0
Content-Type: application/json;odata=verbose;charset=utf-8
Expires: Mon, 01 Apr 2019 02:41:44 GMT
Last-Modified: Tue, 16 Apr 2019 02:41:44 GMT
Server: Microsoft-IIS/8.0
X-SharePointHealthScore: 0
SPClientServiceRequestDuration: 493
X-AspNet-Version: 4.0.30319
SPRequestGuid: <the_SPRequestGuid>
request-id: <the_request-id>
X-RequestDigest: <the X-RequestDigest>
X-FRAME-OPTIONS: SAMEORIGIN
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 15.0.0.4927
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1; RequireReadOnly
Date: Tue, 16 Apr 2019 02:41:44 GMT
Vary: Accept-Encoding
Content-Length: 179
Connection: Keep-Alive

{"error":{"code":"-2130575163, Microsoft.SharePoint.SPListDataValidationException","message":{"lang":"fr-FR","value":"\u00c9chec de la validation des donn\u00e9es de la liste."}}}

The same kind of response occured when I try to upload a file. Send request:

POST https://<my_site>/_api/web/lists/getbytitle('Demandes%20de%20travaux')/items(20722)/AttachmentFiles/add(FileName='test.txt') HTTP/1.1
Host: collab.intranet.edf.com
User-Agent: python-requests/2.21.0
Accept-Encoding: gzip, deflate
Accept: application/json; odata=verbose
Connection: keep-alive
Content-Type: application/json; odata=verbose
Cookie: FedAuth=<the_FedAuth>
x-requestdigest: <the_x-requestdigest>
Content-Length: 30

un test en python pour voir...

Response encountered :

HTTP/1.1 500 Internal Server Error
Cache-Control: private, max-age=0
Content-Type: application/json;odata=verbose;charset=utf-8
Expires: Mon, 01 Apr 2019 02:55:03 GMT
Last-Modified: Tue, 16 Apr 2019 02:55:03 GMT
Server: Microsoft-IIS/8.0
X-SharePointHealthScore: 0
SPClientServiceRequestDuration: 347
X-AspNet-Version: 4.0.30319
SPRequestGuid: e963d39e-1f5c-5080-4007-f511401ecf1e
request-id: e963d39e-1f5c-5080-4007-f511401ecf1e
X-RequestDigest: <the x_requestdigest>
X-FRAME-OPTIONS: SAMEORIGIN
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 15.0.0.4927
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1; RequireReadOnly
Date: Tue, 16 Apr 2019 02:55:04 GMT
Vary: Accept-Encoding
Content-Length: 179
Connection: Keep-Alive

{"error":{"code":"-2130575163, Microsoft.SharePoint.SPListDataValidationException","message":{"lang":"fr-FR","value":"\u00c9chec de la validation des donn\u00e9es de la liste."}}}

Do you have any idea of the reason of these failed... the error message is quite vague. Regards.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.