Blog Posts API

Creating Blog Posts

POST /api/v1/blog_posts

Parameters

Name Description
title title
body body

Request

Headers

Accept: application/json
X-Api-Token: 1JqaHz9z1YzYEyYR9Rfwij7PQHNBf4aBhQ
X-Api-Email: user-14@example.com

Route

POST /api/v1/blog_posts

Body

{"title":"a new title","body":"a new body"}

cURL

curl "http://localhost:3000/api/v1/blog_posts" -d '{"title":"a new title","body":"a new body"}' -X POST \
	-H "Accept: application/json" \
	-H "X-Api-Token: 1JqaHz9z1YzYEyYR9Rfwij7PQHNBf4aBhQ" \
	-H "X-Api-Email: user-14@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 471

Status

201 Created

Body

{
  "created_at": "2019-10-31T22:01:39Z",
  "author_bio": null,
  "full_url": "http://school.worksonmy.computer/blog/7/41bdd4",
  "path": "/blog/7/41bdd4",
  "id": 7,
  "school_id": 185,
  "title": "a new title",
  "friendly_url": "41bdd4",
  "body": "a new body",
  "is_published": false,
  "published_at": null,
  "author_bio_id": null,
  "is_disqus_enabled": false,
  "is_native_comments_enabled": false,
  "updated_at": "2019-10-31T22:01:39Z",
  "meta": {
    "class": "blogpost",
    "url": null,
    "name": "7",
    "description": "",
    "image_url": null
  }
}