Full Examples
Here are some complete, end-to-end examples in different languages to help you get started quickly.
The common use case shown below is fetching all comments for a post and then submitting a new one.
Perfect for quick tests from the command line.
bash
API_KEY="YOUR_API_KEY"
BASE_URL="https://blogs.dishis.tech/api/v1"
POST_SLUG="my-first-blog-post"
# 1. Fetch the post's comments to see existing discussion
curl -X GET "$BASE_URL/comments?postSlug=$POST_SLUG" \
-H "Authorization: Bearer $API_KEY"
# 2. Post a new comment
# This assumes you have a separate end-user JWT for this action
curl -X POST "$BASE_URL/comments" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "This is a new comment from cURL!",
"postSlug": "'"$POST_SLUG"'"
}'