Save
Fluwiz API does not differentiate the API end points for create and update. The creation or updation activity is based on multiple criterias such as primary key and unique key combination as sent in the request.
Save record
Individual record
endpoint - https://{server-url}/palmyra/api/v1/{database}/data/{type}
method - POST
Request Body
{
"name" : "selvi",
"dob" : "18-02-2000",
"join_date" : "18-02-2018",
"father" : "madhan",
"city" : "chennai"
}
On successful save, http status code - 200 will be returned
response format will be as below providing all the attributes of the given type.
{
"id" : 20,
"name" : "selvi",
"dob" : "18-02-2000",
"join_date" : "18-02-2018",
"father" : "madhan",
"city" : "chennai"
}
Note the ‘id’ of the record is also returned with the response
Creating record with relations
While creating a record, the children of the record also can be created on the same request.
Along with the fields of the record, provide the child records as below (as Array).
endpoint - https://{server-url}/palmyra/api/v1/{database}/data/{type}
method - POST
Request Body
{
"name" : "selvi",
"dob" : "18-02-2000",
"join_date" : "18-02-2018",
"father" : "madhan",
"city" : "chennai",
"marks" : [
{
"month" : "july",
"english" : 70,
"tamil" : 82,
"maths" : 72,
"science" : 78
}
]
}
On successful creation, http status code - 201 will be returned
response format will be as below providing all the attributes of the given type. Please note that the children records are not returned.
{
"id" : 20,
"name" : "selvi",
"dob" : "18-02-2000",
"join_date" : "18-02-2018",
"father" : "madhan",
"city" : "chennai"
}
Note the ‘id’ of the record is also returned with the response
Multiple records
endpoint - https://{server-url}/palmyra/api/v1/{database}/data/{type}/multi
method - POST
Request Body
[{
"name" : "Sylvia",
"dob" : "18-02-2000",
"join_date" : "18-02-2018",
"father" : "Antony",
"city" : "chennai"
},
{
"name" : "John",
"dob" : "18-02-2000",
"join_date" : "18-02-2018",
"father" : "madhan",
"city" : "chennai"
}]
On successful save, http status code - 200 will be returned