Yorumlar API
Yorumlar modülünün tüm işlemleri (9) ve veri modelleri (3): adresler, izinler, girdiler, ön koşullar, olaylar ve örnekler.
Herhangi bir kayıtta ekibiniz için notlar ve yanıtlar.
Modül kodu comments · 9 işlem · 3 veri modeli · 9 olay. Bir anahtar ya da token, arkasındaki kişinin bu modülde yapabildiğinden fazlasını asla yapamaz; satır düzeyindeki güvenlik uygulamadakiyle birebir aynıdır. Yetki kapsamları: comments (hepsi), comments:read (yalnız okuma) ya da comments:<yetenek>.
Kaynaklar
| Kaynak | Tablo | Listeleme ve okuma | POST | PATCH | DELETE |
|---|---|---|---|---|---|
comment_mentions | comment_mention | /api/v1/comment_mentions | |||
comment_reactions | comment_reaction | /api/v1/comment_reactions | |||
comments | comment | /api/v1/comments | comments.delete |
Listeler limit (en çok 200), cursor, order (ör. -created_at), fields ve q alır; diğer her sorgu parametresi bir sütun süzgecidir: ?status=paid, ?total[gte]=100, ?id[in]=a,b, ?x=null.
İşlemler
| İşlem | Gereken izin | Ne yapar |
|---|---|---|
comments.delete | comments:read | Yorumu sil |
comments.edit | comments:read | Yorumu düzenle |
comments.post | comments:read | Kayda yorum yaz |
comments.publish | comments:read | Yorumu yayımla |
comments.react | comments:read | Yoruma tepki ver |
comments.reopen | comments:read | Konuyu yeniden aç |
comments.reply | comments:read | Yoruma yanıt ver |
comments.resolve | comments:read | Konuyu çözüldü olarak işaretle |
comments.unpublish | comments:read | Yorumu yayından kaldır |
comments.delete
Yorumu sil — Yorumu konudan kaldırır. Yanıtlar kalır ve ana yorum olur.
Gereken izin comments:read · siler ya da geri alınamaz · Era çalıştırırken bir kişiye onaylatır
https://app.getera.io/api/v1/comments/{id}/actions/delete- REST kısayolu:
DELETE /api/v1/comments/{id} - Asıl adres:
POST /api/v1/actions/comments.delete
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | evet | Doldurulduğu yer: adresteki {id} · Yorum · kimliği: comment |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
comment_not_found | Yorum bulunmalı. |
cannot_delete_comment | Başkasının yorumunu kaldırmak, hedefin modülünde silme yetkisi gerektirir. |
Yayımladığı olaylar: comments.deleted
Neye yazar: comment (update) — Stamps deleted_at
curl -X POST https://app.getera.io/api/v1/comments/COMMENT_ID/actions/delete \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'{
"ok": true,
"result": "…",
"events": [
"comments.deleted"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.comments.delete("COMMENT_ID")era comments delete COMMENT_ID{
"name": "era__comments__delete",
"arguments": {
"id": "COMMENT_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde comments:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 comment_not_found, cannot_delete_comment · 429 çok sık istek
comments.edit
Yorumu düzenle — Yazdığınız bir yorumu yeniden yazar ve değiştiğini ekranda belirtir.
Gereken izin comments:read · veriyi değiştirir
https://app.getera.io/api/v1/comments/{id}/actions/edit- Asıl adres:
POST /api/v1/actions/comments.edit
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | evet | Doldurulduğu yer: adresteki {id} · Yorum · kimliği: comment |
body | string | evet | Yorum · en çok 20000 |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
comment_not_found | Yorum bulunmalı. |
not_author | Metni yalnızca yazan değiştirebilir. |
empty_body | Yorum boş olamaz. |
mentioned_cannot_read | Kimse açamadığı bir kayıtta anılamaz. |
Yayımladığı olaylar: comments.edited, comments.mentioned
Neye yazar: comment (update) — Rewrites the body and stamps edited_at; comment_mention (insert) — Records anyone newly mentioned
curl -X POST https://app.getera.io/api/v1/comments/COMMENT_ID/actions/edit \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"body":"Comment"}'{
"ok": true,
"result": "…",
"events": [
"comments.edited",
"comments.mentioned"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.comments.edit("COMMENT_ID", {
body: "Comment"
})era comments edit COMMENT_ID \
--body "Comment"{
"name": "era__comments__edit",
"arguments": {
"id": "COMMENT_ID",
"body": "Comment"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde comments:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 comment_not_found, not_author, empty_body, mentioned_cannot_read · 429 çok sık istek
comments.post
Kayda yorum yaz — Bir kayda yorum ekler. Biri yayımlayana kadar iç yorumdur.
Gereken izin comments:read · veriyi değiştirir
https://app.getera.io/api/v1/comments/actions/post- Asıl adres:
POST /api/v1/actions/comments.post
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
recordType | string | evet | Kayıt türü · en çok 60 |
recordId | uuid | evet | Kayıt |
body | string | evet | Yorum · en çok 20000 |
mentions | object / array | Bahsedilmeler |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
unknown_record_type | Kayıt türü bir modülün sahip olduğu türlerden olmalı. |
cannot_comment | Yorum yapmak, hedefin modülünde yorum yetkisi gerektirir. |
empty_body | Yorum boş olamaz. |
record_not_found | Kayıt bulunmalı. |
mentioned_cannot_read | Kimse açamadığı bir kayıtta anılamaz. |
Yayımladığı olaylar: comments.posted, comments.mentioned
Neye yazar: comment (insert) — Writes the comment; comment_mention (insert) — Records who was mentioned
curl -X POST https://app.getera.io/api/v1/comments/actions/post \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"recordType":"Record type","recordId":"RECORD_ID","body":"Comment"}'{
"ok": true,
"result": "…",
"events": [
"comments.posted",
"comments.mentioned"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.comments.post({
recordType: "Record type",
recordId: "RECORD_ID",
body: "Comment"
})era comments post \
--record-type "Record type" \
--record-id "RECORD_ID" \
--body "Comment"{
"name": "era__comments__post",
"arguments": {
"recordType": "Record type",
"recordId": "RECORD_ID",
"body": "Comment"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde comments:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 unknown_record_type, cannot_comment, empty_body, record_not_found, mentioned_cannot_read · 429 çok sık istek
comments.publish
Yorumu yayımla — Yorumu mağaza sitesinde gösterir. Varsayılan olarak yapılmaz.
Gereken izin comments:read · dışarıya ulaşır (gönderir, yayımlar ya da ücret alır) · Era çalıştırırken bir kişiye onaylatır
https://app.getera.io/api/v1/comments/{id}/actions/publish- Asıl adres:
POST /api/v1/actions/comments.publish
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | evet | Doldurulduğu yer: adresteki {id} · Yorum · kimliği: comment |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
comment_not_found | Yorum bulunmalı. |
cannot_manage_record | Yayımlamak, hedefin modülünde yönetim yetkisi gerektirir. |
is_a_reply | Yanıt, konusuyla birlikte yayımlanır. |
already_public | Yorum gizli olmalı. |
Yayımladığı olaylar: comments.published
Neye yazar: comment (update) — Sets is_public
curl -X POST https://app.getera.io/api/v1/comments/COMMENT_ID/actions/publish \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'{
"ok": true,
"result": "…",
"events": [
"comments.published"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.comments.publish("COMMENT_ID")era comments publish COMMENT_ID{
"name": "era__comments__publish",
"arguments": {
"id": "COMMENT_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde comments:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 comment_not_found, cannot_manage_record, is_a_reply, already_public · 429 çok sık istek
comments.react
Yoruma tepki ver — Bir yoruma tepkinizi ekler; daha önce verdiyseniz geri alır.
Gereken izin comments:read · siler ya da geri alınamaz
https://app.getera.io/api/v1/comment_reactions/actions/react- Asıl adres:
POST /api/v1/actions/comments.react
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | evet | Yorum · kimliği: comment |
reaction | string | evet | Tepki · en çok 32 |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
invalid_reaction | Tepki, sunulan sekiz tepkiden biri olmalı. |
comment_not_found | Yorum bulunmalı. |
cannot_comment | Tepki vermek, hedefin modülünde yorum yetkisi gerektirir. |
Yayımladığı olaylar: comments.reacted
Neye yazar: comment_reaction (insert) — Adds the reaction; comment_reaction (delete) — Takes a reaction back
curl -X POST https://app.getera.io/api/v1/comment_reactions/actions/react \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"id":"COMMENT_ID","reaction":"Reaction"}'{
"ok": true,
"result": "…",
"events": [
"comments.reacted"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.commentReactions.react({
id: "COMMENT_ID",
reaction: "Reaction"
})era comment_reactions react \
--id "COMMENT_ID" \
--reaction "Reaction"{
"name": "era__comments__react",
"arguments": {
"id": "COMMENT_ID",
"reaction": "Reaction"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde comments:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 invalid_reaction, comment_not_found, cannot_comment · 429 çok sık istek
comments.reopen
Konuyu yeniden aç — Çözülmüş bir konuyu listeye geri koyar.
Gereken izin comments:read · veriyi değiştirir
https://app.getera.io/api/v1/comments/{id}/actions/reopen- Asıl adres:
POST /api/v1/actions/comments.reopen
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | evet | Doldurulduğu yer: adresteki {id} · Yorum · kimliği: comment |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
comment_not_found | Yorum bulunmalı. |
cannot_comment | Yeniden açmak, hedefin modülünde yorum yetkisi gerektirir. |
not_resolved | Konu çözülmüş olmalı. |
Yayımladığı olaylar: comments.reopened
Neye yazar: comment (update) — Clears resolved_at
curl -X POST https://app.getera.io/api/v1/comments/COMMENT_ID/actions/reopen \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'{
"ok": true,
"result": "…",
"events": [
"comments.reopened"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.comments.reopen("COMMENT_ID")era comments reopen COMMENT_ID{
"name": "era__comments__reopen",
"arguments": {
"id": "COMMENT_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde comments:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 comment_not_found, cannot_comment, not_resolved · 429 çok sık istek
comments.reply
Yoruma yanıt ver — Bir yorumu yanıtlar. Yanıtlar yalnızca bir seviye derine iner.
Gereken izin comments:read · veriyi değiştirir
https://app.getera.io/api/v1/comments/{id}/actions/reply- Asıl adres:
POST /api/v1/actions/comments.reply
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
parentId | uuid | evet | Doldurulduğu yer: adresteki {id} · Yorum · kimliği: comment |
body | string | evet | Yanıtla · en çok 20000 |
mentions | object / array | Bahsedilmeler |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
parent_not_found | Yanıtlanan yorum bulunmalı. |
parent_is_a_reply | Bir yanıta yanıt verilemez. |
cannot_comment | Yanıtlamak, hedefin modülünde yorum yetkisi gerektirir. |
empty_body | Yanıt boş olamaz. |
mentioned_cannot_read | Kimse açamadığı bir kayıtta anılamaz. |
Yayımladığı olaylar: comments.posted, comments.mentioned
Neye yazar: comment (insert) — Writes the reply; comment_mention (insert) — Records who was mentioned
curl -X POST https://app.getera.io/api/v1/comments/COMMENT_ID/actions/reply \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"body":"Reply"}'{
"ok": true,
"result": "…",
"events": [
"comments.posted",
"comments.mentioned"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.comments.reply("COMMENT_ID", {
body: "Reply"
})era comments reply COMMENT_ID \
--body "Reply"{
"name": "era__comments__reply",
"arguments": {
"parentId": "COMMENT_ID",
"body": "Reply"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde comments:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 parent_not_found, parent_is_a_reply, cannot_comment, empty_body, mentioned_cannot_read · 429 çok sık istek
comments.resolve
Konuyu çözüldü olarak işaretle — Konuyu kapanmış olarak işaretler; panel geriye kalanların listesi olur.
Gereken izin comments:read · veriyi değiştirir
https://app.getera.io/api/v1/comments/{id}/actions/resolve- Asıl adres:
POST /api/v1/actions/comments.resolve
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | evet | Doldurulduğu yer: adresteki {id} · Yorum · kimliği: comment |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
comment_not_found | Yorum bulunmalı. |
cannot_comment | Çözüldü işaretlemek, hedefin modülünde yorum yetkisi gerektirir. |
is_a_reply | Yanıt, konusunun durumunu paylaşır. |
already_resolved | Konu açık olmalı. |
Yayımladığı olaylar: comments.resolved
Neye yazar: comment (update) — Stamps resolved_at
curl -X POST https://app.getera.io/api/v1/comments/COMMENT_ID/actions/resolve \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'{
"ok": true,
"result": "…",
"events": [
"comments.resolved"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.comments.resolve("COMMENT_ID")era comments resolve COMMENT_ID{
"name": "era__comments__resolve",
"arguments": {
"id": "COMMENT_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde comments:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 comment_not_found, cannot_comment, is_a_reply, already_resolved · 429 çok sık istek
comments.unpublish
Yorumu yayından kaldır — Yayımlanmış bir yorumu mağaza sitesinden geri alır.
Gereken izin comments:read · veriyi değiştirir
https://app.getera.io/api/v1/comments/{id}/actions/unpublish- Asıl adres:
POST /api/v1/actions/comments.unpublish
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | evet | Doldurulduğu yer: adresteki {id} · Yorum · kimliği: comment |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
comment_not_found | Yorum bulunmalı. |
cannot_manage_record | Yayından kaldırmak, hedefin modülünde yönetim yetkisi gerektirir. |
already_private | Yorum herkese açık olmalı. |
Yayımladığı olaylar: comments.unpublished
Neye yazar: comment (update) — Clears is_public
curl -X POST https://app.getera.io/api/v1/comments/COMMENT_ID/actions/unpublish \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'{
"ok": true,
"result": "…",
"events": [
"comments.unpublished"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.comments.unpublish("COMMENT_ID")era comments unpublish COMMENT_ID{
"name": "era__comments__unpublish",
"arguments": {
"id": "COMMENT_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde comments:read izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 comment_not_found, cannot_manage_record, already_private · 429 çok sık istek
Veri modelleri
CommentMention
Tablo comment_mention · Kaynak comment_mentions
GET /api/v1/comment_mentionsGET /api/v1/comment_mentions/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
comment_id | string (uuid) · uuid | comment | ||
user_id | string (uuid) · uuid | app_user | ||
created_at | string (date-time) · timestamptz |
Birincil anahtar: id
CommentReaction
Tablo comment_reaction · Kaynak comment_reactions
GET /api/v1/comment_reactionsGET /api/v1/comment_reactions/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
comment_id | string (uuid) · uuid | comment | ||
user_id | string (uuid) · uuid | app_user | ||
reaction | string · text | |||
created_at | string (date-time) · timestamptz |
Birincil anahtar: id
Tekil: comment_id, user_id, reaction
Denetimler:
CHECK (((length(reaction) >= 1) AND (length(reaction) <= 32)))
Comment
Tablo comment · Kaynak comments
GET /api/v1/commentsGET /api/v1/comments/{id}DELETE /api/v1/comments/{id}→comments.delete
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
record_type | string · text | |||
record_id | string (uuid) · uuid | |||
body | string · text | |||
author_user_id | string (uuid) · uuid | evet | app_user | |
author_label | string · text | evet | ||
is_public | boolean · bool | |||
parent_id | string (uuid) · uuid | evet | comment | |
resolved_at | string (date-time) · timestamptz | evet | ||
resolved_by_user_id | string (uuid) · uuid | evet | app_user | |
edited_at | string (date-time) · timestamptz | evet | ||
deleted_at | string (date-time) · timestamptz | evet | ||
created_at | string (date-time) · timestamptz | |||
updated_at | string (date-time) · timestamptz |
Birincil anahtar: id
Denetimler:
CHECK ((length(btrim(body)) > 0))CHECK (((parent_id IS NULL) OR (parent_id <> id)))CHECK (((resolved_at IS NULL) OR (parent_id IS NULL)))CHECK (((resolved_at IS NULL) = (resolved_by_user_id IS NULL)))
Olaylar
İş akışları ve webhook'lar bu olaylara tepki verir.
| Olay | Ne olur | Taşıdığı alanlar |
|---|---|---|
comments.deleted | Bir yorum konuşmadan kaldırıldı. | id |
comments.edited | Bir yorumu yazarı yeniden yazdı. | id |
comments.mentioned | Bir yorumda biri anıldı. Yeni anılan her kişi için bir olay. | id, commentId, mentionedUserId, recordType, recordId, authorUserId |
comments.posted | Bir yorum ya da yanıt yazıldı. | id, recordType, recordId |
comments.published | Bir yorum vitrinde gösterildi. | id |
comments.reacted | Bir yoruma tepki eklendi ya da geri alındı. | id, reaction, added, authorUserId |
comments.reopened | Çözülmüş bir konuşma yeniden açıldı. | id |
comments.resolved | Bir konuşma çözüldü olarak işaretlendi. | id |
comments.unpublished | Bir yorum vitrinden kaldırıldı. | id |