Create a post
POST
/shops/{shop_id}/postsAuthorization
AuthorizationBearer token (JWT) · headerrequiredPath parameters
shop_idintegerrequiredRequest body
requiredapplication/jsontitlestringrequiredbodystringrequiredslugstringAuto-generated from title if blank
descriptionstringshort_descriptionstringpublishedbooleandefault: false
published_onstring<date-time>formatstringdefault: "html"
Allowed:
htmlmarkdownResponses
201Post created
_linksHalLinksidintegershop_idintegertitlestringslugstringbodystringdescriptionstringshort_descriptionstringpublishedbooleanThere is no `status` field — this is a boolean.
published_onstring<date-time>formatstringAllowed:
htmlmarkdownuser_idintegercreated_onstring<date-time>updated_onstring<date-time>422Validation error
Request
curl -X POST "https://api.onbolder.com/v2/shops/1/posts" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Winter Sale",
"body": "<p>Save big!</p>",
"published": true
}'const response = await fetch("https://api.onbolder.com/v2/shops/1/posts", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"title": "Winter Sale",
"body": "<p>Save big!</p>",
"published": true
})
});import requests
response = requests.post(
"https://api.onbolder.com/v2/shops/1/posts",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"title": "Winter Sale",
"body": "<p>Save big!</p>",
"published": True
},
)Response
{
"_links": {
"property1": {
"href": "string",
"templated": true,
"method": "get",
"title": "string",
"type": "string"
},
"property2": {
"href": "string",
"templated": true,
"method": "get",
"title": "string",
"type": "string"
}
},
"id": 0,
"shop_id": 0,
"title": "string",
"slug": "string",
"body": "string",
"description": "string",
"short_description": "string",
"published": true,
"published_on": "2019-08-24T14:15:22Z",
"format": "html",
"user_id": 0,
"created_on": "2019-08-24T14:15:22Z",
"updated_on": "2019-08-24T14:15:22Z"
}Validation error