Create Inspiration

Create Inspiration

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/inspiration

Body : JSON

{
	"title": "New Inspiration",
	"image_url": "https://images.unsplash.com/photo-1571366343168-631c5bcca7a4?q=80&w=720",
	"content": "Inspiration Content",
	"url": "https://www.instagram.com/p/CvMgJUPBZz3",
	"latlng": [-2.3723687086440504, 113.11523437500001]
}
title*Required
string

Inspiration title.

image_url*Required
string

Inspiration image URL

content*Required
string

Inspiration content

url
string

Inspiration URL

latlng
array of double

Inspiration latitude and longtitude.

[latitude (-2.372), longtitude (113.115)]

Response : 200 - OK

{
  "message": "Success add inspiration"
}

Response : 422 - Unprocessable Content

{
    "message": [
        {
            "code": "too_small",
            "minimum": 1,
            "type": "string",
            "inclusive": true,
            "exact": false,
            "message": "Title is required",
            "path": [
                "title"
            ]
        },
        {
            "validation": "url",
            "code": "invalid_string",
            "message": "Invalid Image URL",
            "path": [
                "image_url"
            ]
        },
        {
            "code": "too_small",
            "minimum": 50,
            "type": "string",
            "inclusive": true,
            "exact": false,
            "message": "Content must be 50 or more characters long",
            "path": [
                "content"
            ]
        }
    ]
}

Response : 500 - Server Error

Internal Server Error