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
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"
}
Success Response
Code : 201 Created
Content example
{
"id": 21735,
"listname": "ANALYST",
"sort": 10,
"display": "UG",
"remark": "Underground"
}
Error Response
Condition : If 'display' is empty.
Code : 422 Unprocessable Entity
Content :
[
{
"field": "display",
"message": "Display cannot be blank."
}
]