URL: /api/blog/v1.0/blog/{blog}/posts
Method: POST
Example request in python:
import requests, json
from sjcl import SJCL
post_encrypted = SJCL().encrypt(
json.dumps({
"author": "Cryptedblog-Team",
"title": "This is a test blog entry",
"tags": [
"tag1", "tag2"
],
"content": "Just a test post! Click [here](http://www.cryptedblog.com) to go to the main page.",
"images": [
{"title": "title", "alt": "title", "width": 90, "height": 90 }
]
}),
"YourSharedSecret")
images_encrypted = SJCL().encrypt(
json.dumps(
[
{"data": "data:image/png;base64,...<put real data here>...."}
]),
"YourSharedSecret")
response = requests.post(
'http://www.cryptedblog.com/api/blog/v1.0/blog/test-blog/posts',
data=json.dumps({
"post-encrypted": post_encrypted,
"images-encrypted": images_encrypted,
"write-id": "7e5f3ce982194fff914029dbab29fa70",
"password": "BadPassword", # optional post password
})
)
data = response.json()
print(json.dumps(data, indent=4, sort_keys=True))
The output looks like the following:
{
"data": {
"post": 5652383656837120,
"post-url": "/api/blog/v1.0/blog/test-blog/posts/5652383656837120"
},
"success": true
}