Skip to main content

Create comment

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

Method: POST

POST data fields:

Comment-encrypted data fields:

Example

Example request in python:

import requests, json
from sjcl import SJCL

comment_encrypted = SJCL().encrypt(
    json.dumps({
    "author": "Cryptedblog-Team", 
    "content": "Just a test comment! Click [here](http://www.cryptedblog.com) to go to the main page.", 
    }),
    "YourSharedSecret")

response = requests.post(
    'http://www.cryptedblog.com/api/blog/v1.0/blog/test-blog/posts/5671831268753408/comments',
    data=json.dumps({
        "comment-encrypted": comment_encrypted,
        "write-id": "7e5f3ce982194fff914029dbab29fa70",
        "password": "BadPassword", # optional comment password
        })
    )
data = response.json()
print(json.dumps(data, indent=4, sort_keys=True))

The output looks like the following:

{
    "data": {
        "comment": 5717495361044480, 
        "comment-url": "/api/blog/v1.0/blog/test-blog/posts/5671831268753408/comments/5717495361044480"
    }, 
    "success": true
}