Skip to content

BoltCMS extension allow create and edit content via REST API

Notifications You must be signed in to change notification settings

zillingen/json-content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON content

JSON-content is the BoltCMS extension allow to create and edit content using REST API

Configuration

After extension was installed you need change access token in the extension's config. This token need to authenticate requests of your HTTP client.

Config example:

path: /api/content
auth:
  enabled: true
  access_token: LeeD7che3sohs8ou8iizegeepai9oup

REST schema

View

View record by id

Example:

curl -X GET http://localhost:8000/api/content/entry/1

Create

Create record from json

Example:

curl -X POST \
     -H 'Content-Type: application/json' \
     -H 'X-Auth-Token: LeeD7che3sohs8ou8iizegeepai9oup' \ 
     -d '{"title":"My new entry","slug":"my-new-entry","ownerid":"1","status":"published"}' \
     http://localhost:8000/api/content/entry

You can create content entity with taxonomies.

POST request example with more advanced JSON:

POST http://localhost:8000/api/content/posts
Content-Type: application/json
X-Auth-Token: LeeD7che3sohs8ou8iizegeepai9oup

{
  "slug": "new-blog-post",
  "ownerid": 1,
  "status": "published",
  "title": "New blog post",
  "image": {
    "file": "2020-01/post-image.jpg"
  },
  "taxonomy": {
    "tags": [
      {
        "name": "News",
        "slug": "news"
      },
      {
        "name": "Review",
        "slug": "reviews"
      }
    ],
    "categories": [
      {
        "slug": "news",
        "name": "News"
      }
    ]
  }
}

Patch

Patch content entity fields

Example:

curl -X PATCH \
     -H 'Content-Type: application/json' \
     -H 'X-Auth-Token: LeeD7che3sohs8ou8iizegeepai9oup' \ 
     -d '{"title":"Patched title"}' \
     http://localhost:8000/api/content/entry/1

About

BoltCMS extension allow create and edit content via REST API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages