Support > Wagby Developer Network(R7) > REST API usage guide > Update [2] Simple control
ja | en

There are two methods of updating. In this section, we will explain how to lock, update and unlock data collectively in one process. R7.5.1

We will send data including the primary key of the target data.

@RequestMapping(value="/rest/[modelid]/edit/{pkey}", method=PUT, headers="Content-Type=application/x-www-form-urlencoded")

URL Example

http://localhost:8921/wagby/rest/customer/edit/1000

Request description

Specify parameters similar to the form screen.(However, since the primary key is included in the URL, specify update data excluding the primary key.)
Example:
customer_p$002fname=Satou

response

STATUS=200 OK
Here is an example of the content of the return.

{
 "entityp": {
   "customerid_": {
     "content_":"1000",
     "formatted_": null,
     "errorcode_":""
   },
   "name_": {
     "content_":"Satou",
     "formatted_": null,
     "errorcode_":""
   },
   "email_": [
     {
       "id_": 1,
       "priority_": null,
       "content_": null,
       "errorcode_":""
     }
   ]
 },
 "errors": {
   "jfcinfo": [],
   "jfcwarn": [],
   "jfcdebug": [],
   "jfcerror": []
 },
 "status":"updateCustomer.input",
 "pkey": null,
 "entity": {
   "customerid_": 1000,
   "name_": "Satou",
   "email_": []
 }
}

This API is "Automatic logonIt is supposed to be used in conjunction with. Specifically, by calling the update API by setting "X - Wagby - Authorization" in the request header, we can realize the flow of logon & update & logoff at once.