Skip to main content

Update post

URL: /api/blog/v1.0/blog/{blog}/posts/{post}

Method: PUT (POST)

PUT (POST) data fields:

Blog-encrypted data fields:

Example

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 - updated",
    "tags": [
        "tag1", "tag2"
    ], 
    "content": "Just a test post! Click [here](http://www.cryptedblog.com) to go to the main page. This post was updated.", 
    "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.put(
    'http://www.cryptedblog.com/api/blog/v1.0/blog/test-blog/posts/5671831268753408',
    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": 5671831268753408, 
        "post-url": "/api/blog/v1.0/blog/test-blog/posts/5671831268753408"
    }, 
    "success": true
}