Create Province
To create the data in the specified collection with the specified parameters. When a JSON object is saved, the object properties are automatically added to the collection you specified.
Method : POST
URL : /api/province
Body : JSON
{
"name": "New Province",
"image_url": "https://images.unsplash.com/photo-1682687220063-4742bd7fd538?auto=format&fit=crop&q=60&w=500",
"island_id": 1
}
name*Required
string
Province name.
image_url*Required
string
Province image URL
island_id
number
Province island ID
Response : 200 - OK
{
"message": "Success add province"
}
Response : 422 - Unprocessable Content
{
"error": [
{
"code": "too_small",
"minimum": 1,
"type": "string",
"inclusive": true,
"exact": false,
"message": "Name is required",
"path": [
"name"
]
},
{
"code": "too_small",
"minimum": 1,
"type": "string",
"inclusive": true,
"exact": false,
"message": "Image URL is required",
"path": [
"image_url"
]
}
]
}
Response : 500 - Server Error
Internal Server Error