Update

Used to update an existing record of a data model

URL : /api/v1/global/<id:integer>

URL Parameters :

  • name=[string] : data model name
  • id=[integer] : id of an existed data model record

Method : PUT

Auth required : YES

Permissions required

  • Roles: _administrator_, developer, operator
  • Permissions: form-<data model name>:edit

Data constraints Depends on the data model. These constraints are defined in the data model class usually under rules(). Check Yii2 - Validating Input (opens new window)

Data example

Depends on the data model structure. An object that represents a table row (Model Instance) should be sent as pairs of the field name and corresponding values.

ListValue item update example

{
	"display": "MZZ"
}
1
2
3

Success Response

Code : 200 OK

Content example The updated record

{
    "id": 100,
    "listname": "ANALYST",
    "display": "MZZ",
    "remark": "Martin Ziegler",
    "sort": 81
}
1
2
3
4
5
6
7

Error Response

Condition : If 'display' is empty.

Code : 422 Unprocessable entity

Content :

[
    {
        "field": "display",
        "message": "Display cannot be blank."
    }
]
1
2
3
4
5
6