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

KaynakTabloListeleme ve okumaPOSTPATCHDELETE
comment_mentionscomment_mention/api/v1/comment_mentions
comment_reactionscomment_reaction/api/v1/comment_reactions
commentscomment/api/v1/commentscomments.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

İşlemGereken izinNe yapar
comments.deletecomments:readYorumu sil
comments.editcomments:readYorumu düzenle
comments.postcomments:readKayda yorum yaz
comments.publishcomments:readYorumu yayımla
comments.reactcomments:readYoruma tepki ver
comments.reopencomments:readKonuyu yeniden aç
comments.replycomments:readYoruma yanıt ver
comments.resolvecomments:readKonuyu çözüldü olarak işaretle
comments.unpublishcomments:readYorumu 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

POSThttps://app.getera.io/api/v1/comments/{id}/actions/delete
API anahtarı ya da OAuth token · comments:read
  • REST kısayolu: DELETE /api/v1/comments/{id}
  • Asıl adres: POST /api/v1/actions/comments.delete

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Yorum · kimliği: comment

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
comment_not_foundYorum bulunmalı.
cannot_delete_commentBaş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 '{}'
Yanıt
{
  "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
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/comments/{id}/actions/edit
API anahtarı ya da OAuth token · comments:read
  • Asıl adres: POST /api/v1/actions/comments.edit

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Yorum · kimliği: comment
bodystringevetYorum · en çok 20000

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
comment_not_foundYorum bulunmalı.
not_authorMetni yalnızca yazan değiştirebilir.
empty_bodyYorum boş olamaz.
mentioned_cannot_readKimse 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"}'
Yanıt
{
  "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"
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/comments/actions/post
API anahtarı ya da OAuth token · comments:read
  • Asıl adres: POST /api/v1/actions/comments.post

Girdi

AlanTürZorunluAçıklama
recordTypestringevetKayıt türü · en çok 60
recordIduuidevetKayıt
bodystringevetYorum · en çok 20000
mentionsobject / arrayBahsedilmeler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
unknown_record_typeKayıt türü bir modülün sahip olduğu türlerden olmalı.
cannot_commentYorum yapmak, hedefin modülünde yorum yetkisi gerektirir.
empty_bodyYorum boş olamaz.
record_not_foundKayıt bulunmalı.
mentioned_cannot_readKimse 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"}'
Yanıt
{
  "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"
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/comments/{id}/actions/publish
API anahtarı ya da OAuth token · comments:read
  • Asıl adres: POST /api/v1/actions/comments.publish

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Yorum · kimliği: comment

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
comment_not_foundYorum bulunmalı.
cannot_manage_recordYayımlamak, hedefin modülünde yönetim yetkisi gerektirir.
is_a_replyYanıt, konusuyla birlikte yayımlanır.
already_publicYorum 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 '{}'
Yanıt
{
  "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
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/comment_reactions/actions/react
API anahtarı ya da OAuth token · comments:read
  • Asıl adres: POST /api/v1/actions/comments.react

Girdi

AlanTürZorunluAçıklama
iduuidevetYorum · kimliği: comment
reactionstringevetTepki · en çok 32

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
invalid_reactionTepki, sunulan sekiz tepkiden biri olmalı.
comment_not_foundYorum bulunmalı.
cannot_commentTepki 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"}'
Yanıt
{
  "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"
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/comments/{id}/actions/reopen
API anahtarı ya da OAuth token · comments:read
  • Asıl adres: POST /api/v1/actions/comments.reopen

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Yorum · kimliği: comment

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
comment_not_foundYorum bulunmalı.
cannot_commentYeniden açmak, hedefin modülünde yorum yetkisi gerektirir.
not_resolvedKonu çö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 '{}'
Yanıt
{
  "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
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/comments/{id}/actions/reply
API anahtarı ya da OAuth token · comments:read
  • Asıl adres: POST /api/v1/actions/comments.reply

Girdi

AlanTürZorunluAçıklama
parentIduuidevetDoldurulduğu yer: adresteki {id} · Yorum · kimliği: comment
bodystringevetYanıtla · en çok 20000
mentionsobject / arrayBahsedilmeler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
parent_not_foundYanıtlanan yorum bulunmalı.
parent_is_a_replyBir yanıta yanıt verilemez.
cannot_commentYanıtlamak, hedefin modülünde yorum yetkisi gerektirir.
empty_bodyYanıt boş olamaz.
mentioned_cannot_readKimse 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"}'
Yanıt
{
  "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"
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/comments/{id}/actions/resolve
API anahtarı ya da OAuth token · comments:read
  • Asıl adres: POST /api/v1/actions/comments.resolve

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Yorum · kimliği: comment

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
comment_not_foundYorum bulunmalı.
cannot_commentÇözüldü işaretlemek, hedefin modülünde yorum yetkisi gerektirir.
is_a_replyYanıt, konusunun durumunu paylaşır.
already_resolvedKonu 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 '{}'
Yanıt
{
  "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
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/comments/{id}/actions/unpublish
API anahtarı ya da OAuth token · comments:read
  • Asıl adres: POST /api/v1/actions/comments.unpublish

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Yorum · kimliği: comment

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
comment_not_foundYorum bulunmalı.
cannot_manage_recordYayından kaldırmak, hedefin modülünde yönetim yetkisi gerektirir.
already_privateYorum 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 '{}'
Yanıt
{
  "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
tools/call
{
  "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_mentions
  • GET /api/v1/comment_mentions/{id}
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
comment_idstring (uuid) · uuidcomment
user_idstring (uuid) · uuidapp_user
created_atstring (date-time) · timestamptz

Birincil anahtar: id

CommentReaction

Tablo comment_reaction · Kaynak comment_reactions

  • GET /api/v1/comment_reactions
  • GET /api/v1/comment_reactions/{id}
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
comment_idstring (uuid) · uuidcomment
user_idstring (uuid) · uuidapp_user
reactionstring · text
created_atstring (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/comments
  • GET /api/v1/comments/{id}
  • DELETE /api/v1/comments/{id} → comments.delete
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
record_typestring · text
record_idstring (uuid) · uuid
bodystring · text
author_user_idstring (uuid) · uuidevetapp_user
author_labelstring · textevet
is_publicboolean · bool
parent_idstring (uuid) · uuidevetcomment
resolved_atstring (date-time) · timestamptzevet
resolved_by_user_idstring (uuid) · uuidevetapp_user
edited_atstring (date-time) · timestamptzevet
deleted_atstring (date-time) · timestamptzevet
created_atstring (date-time) · timestamptz
updated_atstring (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.

OlayNe olurTaşıdığı alanlar
comments.deletedBir yorum konuşmadan kaldırıldı.id
comments.editedBir yorumu yazarı yeniden yazdı.id
comments.mentionedBir yorumda biri anıldı. Yeni anılan her kişi için bir olay.id, commentId, mentionedUserId, recordType, recordId, authorUserId
comments.postedBir yorum ya da yanıt yazıldı.id, recordType, recordId
comments.publishedBir yorum vitrinde gösterildi.id
comments.reactedBir yoruma tepki eklendi ya da geri alındı.id, reaction, added, authorUserId
comments.reopenedÇözülmüş bir konuşma yeniden açıldı.id
comments.resolvedBir konuşma çözüldü olarak işaretlendi.id
comments.unpublishedBir yorum vitrinden kaldırıldı.id
Bu sayfa yardımcı oldu mu?