REST API

답글과 지표

글 밑의 스레드를 읽고, 답하고, 원치 않는 것을 숨기고, 숫자를 봅니다.

답글은 워크스페이스가 아니라 발행에 붙습니다. 여기 모든 호출이 글을 발행 라우트와 같은 방식으로 받습니다. POST /v1/posts 로 받은 발행 id, 채널이 준 글 id, 인코딩한 글 링크입니다.

여러 채널에 나간 글

발행 하나가 여러 채널에 나가면 채널마다 사본이 따로 있고 답글도 따로 달립니다. 여기 모든 호출은 사본 하나에 닿습니다. accountId 가 말하는 사본, 채널 링크가 가리키는 사본, 답하는 댓글의 주인 사본(자동화 실행의 triggerRef 처럼 우리가 아는 답글 id) 순입니다. 이 가운데 아무것도 없으면 읽기는 하나를 골라 읽고 응답의 accountId · platform 에 어느 사본인지, otherAccounts 에 나머지를 싣습니다. 쓰기는 아무것도 없거나 둘이 서로 다른 사본을 가리키면 보내지 않고 400 account_required 와 accounts [{ id, platform, handle }] 로 답합니다. 그 동작을 못 하는 채널은 목록에서 빠지고 메시지에 이유가 적힙니다.

GET/v1/posts/{id}/replies

발행한 글 밑의 답글 스레드.

이름타입설명
accountIdqueryWhich channel's copy to read, on a post that went to more than one channel. Omit and the answer says which copy it read.

POST/v1/posts/{id}/replies

글에 답하거나, 그 밑의 답글에 답합니다.

이름타입설명
content필수stringReply text. On Threads, Bluesky and X a reply is a post, so that channel's character limit applies; a longer reply answers 422 content_too_long with limit and actual and nothing is created.
replyTostringA reply id from the thread, or a link to that comment. Omit to answer the post itself.
waitbooleanHold the response until the reply is out, up to 10 seconds. Answers 200 with the post when it settles, otherwise 202 with next.
accountIdstringWhich channel's copy, on a post that went to more than one channel. A connected account id, from list_accounts or a read of this post.

대댓글

replyTo 를 빼면 원글에 답합니다. 답글 id 를 주면 그 답글에 한 단계 더 깊이 답합니다. 따로 엔드포인트가 있는 게 아니라 같은 호출이 둘 다 합니다.

# answer the post
curl -X POST https://api.uplika.com/v1/posts/post_01H.../replies \
  -H "authorization: Bearer $UPLIKA_KEY" \
  -H "content-type: application/json" \
  -d '{"content":"Thanks for reading"}'

# answer a reply — one level deeper
curl -X POST https://api.uplika.com/v1/posts/post_01H.../replies \
  -H "authorization: Bearer $UPLIKA_KEY" \
  -H "content-type: application/json" \
  -d '{"content":"Good question","replyTo":"17901234567890123"}'

남의 글에 하는 것

댓글·공감·이웃은 블로그가 크는 방식이고, 그 대부분은 남의 글에서 일어납니다. 이 셋은 대상을 ownerHandle 과 externalId 로 받습니다 (네이버는 블로그 id 와 링크의 logNo). 내 글이면 postId 로도 됩니다. 행위자는 언제나 연결된 계정이고, ownerHandle 은 상대입니다. 지금은 네이버 블로그만 되고, 발행처럼 확장이 브라우저에서 합니다. 네이버의 공감은 토글이라 상태를 먼저 읽고 켜진 것을 끄지 않습니다. 내 글에 내 공감은 네이버가 조용히 무시해서 naver_not_allowed 로 돌아옵니다.

POST/v1/engagement/like

글에 공감하거나, 그 밑의 댓글에 공감합니다. 멱등이고 취소는 없습니다.

이름타입설명
postIdstringYour own publish. Or pass ownerHandle and externalId instead.
ownerHandlestringWho owns the post. Naver Blog: the blog id.
externalIdstringThe post's id on the channel. Naver Blog: the logNo from the link.
replyIdstringA reply id from the thread to like that reply instead of the post.
accountIdstringWith postId: which channel's copy of your post, and that account acts. With ownerHandle: which connected account acts, only needed with more than one account on that channel.

POST/v1/engagement/reply

내 글이 아닌 글에 댓글을 답니다 (네이버 블로그). 발행 기록은 안 만듭니다.

이름타입설명
ownerHandle필수stringWho owns the post.
externalId필수stringThe post's id on the channel.
content필수stringReply text.
replyIdstringReply under this reply instead of under the post.
secretbooleanNaver Blog: a secret comment only the blog owner can read.

POST/v1/engagement/follow

계정을 팔로우합니다 (네이버 블로그: 이웃추가). mutual 이면 상대가 수락하는 서로이웃 신청이고, 이 신청에는 message 가 꼭 있어야 합니다. group 은 내 이웃 그룹 이름으로 그 그룹에 넣습니다.

이름타입설명
ownerHandle필수stringThe account to follow. Naver Blog: the blog id.
mutualbooleanNaver Blog: send a mutual-neighbor request instead. Comes back pending until accepted.
messagestringRequired with mutual: shown to the other blog. Up to 400 characters.
groupstringNaver Blog: the name of one of your neighbor groups, as it appears on Naver. Leave it out for Naver's default group. Up to 100 characters. Uplika does not create groups: a name the blog does not have answers naver_follow_group_missing, and an older extension answers 422 extension_outdated.
accountIdstringWhich connected account acts.

GET/v1/naver/neighbors/candidates

한 주제로 최근 글을 쓴 블로그를 찾고, 이 계정과 이미 이어진 곳은 뺍니다. 네이버 블로그만, 아무것도 보내지 않습니다.

이름타입설명
query필수stringThe topic, 1 to 100 characters. The server searches Naver's blog search for the newest posts on it and groups them by blog.
mutual필수booleanThe kind of request you will send with follow. true leaves out mutual neighbors, requests already sent and refusals, and keeps one-way neighbors; false keeps only blogs not linked at all.
daysnumberKeep blogs with a post on the topic within this many days, counted back from today. 1 to 30, default 30.
accountIdstringWhich connected Naver Blog to check against. Only needed with more than one.

GET/v1/naver/neighbors/posts

지난 48시간 이웃 새 글을 읽습니다. 글마다 서로이웃인지와 이 연결로 업리카가 이미 공감 · 댓글을 했는지가 붙습니다. 네이버 블로그만, 아무것도 보내지 않습니다.

이름타입설명
neighborsstring"mutual" (default) leaves out posts from blogs known to be one-way neighbors and keeps posts whose relation is unknown (mutual: null). "all" keeps every neighbor's post.
accountIdstringWhich connected Naver Blog to read as. Only needed with more than one.

POST/v1/replies/{replyId}/hide

채널에서 답글을 숨기거나 다시 보이게 합니다.

이름타입설명
postId필수stringThe publish the reply sits under.
hidebooleantrue hides it, false shows it again. Default true.
accountIdstringWhich channel's copy, on a post that went to more than one channel. A connected account id, from list_accounts or a read of this post.

DELETE/v1/replies/{replyId}

댓글을 영구히 지웁니다. 숨기기와 달리 되돌릴 수 없고, 어느 채널이 되는지는 GET /v1/platforms 의 features 에 있습니다.

이름타입설명
postId필수stringThe publish the reply sits under.
accountIdstringWhich channel's copy, on a post that went to more than one channel. A connected account id, from list_accounts or a read of this post.

GET/v1/posts/{id}/insights

조회·좋아요·답글·리포스트·인용·공유.

이름타입설명
accountIdqueryWhich channel's copy to read, on a post that went to more than one channel. Omit and the answer says which copy it read.
{
  "views": 1240,
  "likes": 38,
  "replies": 6,
  "reposts": 2,
  "quotes": 1,
  "shares": null
}

X 의 지표

X 의 지표 읽기는 매번 X 크레딧에서 빠지므로, 지표는 X 연결마다 그 사람이 연결 화면에서 켜고 기본은 꺼져 있습니다. 꺼져 있으면 숫자 없이 200 과 noteCode x_analytics_not_enabled 로 답하고 아무것도 빠지지 않습니다. 켜져 있으면 글 하나에 UTC 하루 한 번까지만 X 를 읽고 지표값을 뺍니다. 그날 다시 부르면 같은 숫자를 돈 없이 돌려줍니다. 잔액이 모자라면 topUpUrl 과 함께 402 x_credits_insufficient 로 답합니다. GET /v1/posts/{id}/thread (open_post) 도 같은 지표를 읽는데, 거기서는 잔액이 모자라면 지표만 null 이고 본문과 답글은 그대로 옵니다.

자주 묻는 것

내 글에 답글을 달려면요?

발행 id 로 reply 를 부르고 replyTo 는 비워 둡니다. 그러면 원글에 답하는 것이고, 스레드가 그렇게 시작됩니다.

답글에 답글을 달려면요?

같은 호출에 그 답글의 id 를 replyTo 로 넘깁니다. 따로 엔드포인트가 있는 게 아니라 호출 하나가 두 깊이를 다 합니다.

어떤 숫자를 볼 수 있나요?

조회·좋아요·답글·리포스트·인용·공유입니다. 플랫폼이 아직 세는 중이면 null 로 오는데, null 은 0 이 아니라 모른다는 뜻입니다.