Forums Oro Community Patch/ Post method in Java

This topic contains 0 replies, has 1 voice, and was last updated by 1 year, 2 months ago.

  • Creator
  • #21822

    Hey Guys,

    Can I get some resources on how to do Patch and Post operations in Java for Rest Api calls in ORO Crm?
    I am using retrofit jar and both Patch as well as Post method is working fine in the sandbox but when I am trying to do the same in Java it’s throwing Bad Request Error. Steps I am following to carry out the Patch/ Post method on ORO Entity..

    1. Generating X-WSSE authorization.
    2. Setting Content-Type as “application/vnd.api+json”.
    3. Sending the Body part as String.
    4. The target endPoint URL is like localhost/api/{entity}.

    Please refer below for the Patch method I am trying to execute:

    RequestBody requestBody = RequestBody.create(MediaType.parse(“application/vnd.api+json”), msg);
    Call<List<OroClient.OroContacts>> call = client.updateContact(id, requestBody);

    “Accept: application/vnd.api+json”,
    “Content-Type: application/vnd.api+json”
    Call<List<OroContacts>> updateContact(@Path(“id”) String id, @Body RequestBody requestBody);

    msg is the string variable containing the Body part. Its like:


    Id id the id of the contact I have to update.

    Please note the same is working fine in api/doc as well as in the Rest Client.

You must be logged in to reply to this topic.