You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by "Patel, Yesha" <ye...@sap.com> on 2017/06/30 20:18:09 UTC
Question: Olingo V4 with MS graph api - Update fails
I am using Olingo V4 odata library to do Update Request.
I am sending a http PATCH request to Users entity type in MS Graph API, but=
it keeps giving error: (Request_BadRequest) Incompatible type kinds were f=
ound. The type 'String' was found to be of kind 'Complex' instead of the ex=
pected kind 'Primitive'. [HTTP/1.1 400 Bad Request]
Header: Authorization =Bearer token https://graph.microsoft.com/v1.0/users/userid
Body: { "id":"userid here", "jobTitle": "developer", "officeLocation": "pal" }
I have checked the metadata and type on on all fields above and it is Edm.String. I am using primitive interface to build the client properties as well.
ODataEntityUpdateRequest<ClientEntity> request =client.getCUDRequestFactory().getEntityUpdateRequest(absoluteUri, UpdateType.PATCH, ce);
request.setFormat(ContentType.JSON_FULL_METADATA);
ODataResponse response =3D ((ODataBasicRequest) request).execute();
int statusCode = response.getStatusCode();
Question: Above I have change URI as MS Graph API uses this URI to send PA=
TCH request for UPDATE operation, is this something olingo limitation or is=
sue is with GRAPH API?