Create

Used to create a new record of a data model.

URL : /api/v1/global/

URL Parameters :

  • name=[data model name]

Method : POST

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 create example

{
  "listname": "ANALYST",
  "sort": 10,
  "display": "UG",
  "remark": "Underground"
}
1
2
3
4
5
6

Success Response

Code : 201 Created

Content example

{
  "id": 21735,
  "listname": "ANALYST",
  "sort": 10,
  "display": "UG",
  "remark": "Underground"
}
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