i

Please enable JavaScript to view this site.

Documentation 8.4

PUT and PATCH methods are used to update a resource. The difference between them is that the PUT method impacts all the attributes of the resource and the PATCH method impacts one or more of those attributes.

 

They use the HTTP PUT and PATCH verbs respectively.

The url contains the collection name and id of the resource to be updated.

The new values of the resource attributes are specified in the request body, that is, the configuration declares a "body" clause.

In the PUT method, all the values for all resource attributes must be specified. On the other hand, in the PATCH method, only the values of the attributes that are to be updated must be specified.

There is no response body.

The modification date (dtLastUpdate) obtained with a query (GET) to the corresponding instance prior to making the modification must be specified.

 

Example: Instance update with Id = 93 from the  "Account" form.

 

 PUT /forms/CRM_ACCOUNT/instances/93

 

The request body ("body" clause) contains:

 

 

{

  "cbIsPartner"false,

  "cdInstanceOwner""JPerez",

  "cdStatus""Active",

  "cdType""1",

  "dsCompany""Tenaris",

  "dsDescription""",

  "dsHolding""TECHINT",

  "dsIndustry""4",

  "dsOwner""Juan Perez",

  "dsSource""Referred",  

  "dtLastUpdate":"1575059822000",

  "dtOpening""1540782000000",

  "emails":"",

  "flLogo"null,

  "idPartnerCompany"null,

  "nuIdentifNumber""30-00000000-5",

  "qtAnualRev""1500000000",

  "qtEmployee"1000,

  "qtScore"90,

  "lsAddress": [

    {

      "lsAddress/dsAddress""Della Paolera 333",

      "lsAddress/dsCity""buenos aires",

      "lsAddress/dsCountry""argentina",

      "lsAddress/dsState""buenos aires",

      "lsAddress/tpAddress""1"

    }

 ], 

  "lsFiles": [

    {

      "lsFiles/dsFile"null,

      "_nuSequence"0

    }

 ],

  "webSiteLine": [

    {

      "webSiteLine/dsWebsite""www.tenaris.com",

      "webSiteLine/tpWebsite""1"

    }

  ],

  "phoneLine": [

    {

      "phoneLine/tpPhone""1",

      "phoneLine/nrPhone""01137489236"

    }

  ],

  "eMailLine": [

    {

      "eMailLine/tpEmail""1",

      "eMailLine/dsEmail""info@tenaris.com"

    }

  ]

}

 

 

 PATCH /forms/CRMACCOUNT/instances/93

 

The request body ("body" clause) contains:

 

 

{

  "dsDescription""Steel company",

  "dsHolding""TECHINT Co",

  "dsIndustry""4" ,  

  "dtLastUpdate":"1687549970000"

}

Send us your comment
Share on Twitter Share on Linkedin Send by Email Print