Talks API¶
Runtime¶
Get Talk¶
GET /core/v1/talks/<talk_id>?include=<inclusions>&mode=<mode>&forced_ids=<forced_ids>
Parameter |
Type |
Description |
---|---|---|
|
String |
Required |
|
String |
Required, values: public, review, manage |
|
Comma-separated list of Strings |
Optional, values: featured-messages, top-level-messages, replies, authors, admins, reactions, bans |
|
Comma-separated list of Strings |
Optional, values: message IDs |
|
String |
Required when messages/replies included, values: best, newest, oldest |
|
Integer |
Required when messages/replies included |
200 OK¶
{
"talk": {
"id": "my-talk-id",
"counts": {
"messages": {
"public": 14,
"featured": 7
}
}
},
"messages": {
"forced": [
{ ... }, // See "Create Message" endpoint
...
],
"featured": [
{ ... }, // See "Create Message" endpoint
...
],
"top-level": [
{ ... }, // See "Create Message" endpoint
...
]
},
"replies": [
{ ... }, // See "Create Message" endpoint
...
],
"authors": [
{ ... }, // See "Create Message" endpoint
...
],
"reactions": [
{ ... }, // See "React to a message" endpoint
...
],
"admins": [
... // See "Create Message" endpoint
],
"bans": [
{ ... }, // See "Ban an author" endpoint
...
]
}
Get Messages¶
GET /core/v1/talks/<talk_id>/messages?order=<order>&limit=<limit>&offset=<offset>&excluded_ids=<excluded_ids>&mode=<mode>
Parameter |
Type |
Description |
---|---|---|
|
String |
Required |
|
String |
Required, values: public, review, manage |
|
String |
Required, values: best, newest, oldest |
|
Integer |
Required |
|
Integer |
Required |
|
Comma-separated list of Strings |
Optional, values: message IDs |
200 OK¶
{
"talk": {
"id": "my-talk-id",
"counts": {
"messages": {
"public": 15,
"featured": 3
}
}
},
"messages": [
{ ... }, // See "Create Message" endpoint
...
],
"authors": [
{ ... }, // See "Create Message" endpoint
...
],
"reactions": [
{ ... }, // See "React to a message" endpoint
...
],
"admins": [
... // See "Create Message" endpoint
],
"bans": [
{ ... }, // See "Ban an author" endpoint
...
]
}
Create Message¶
POST /core/v1/talks/<talk_id>/messages
{
"text": "<text>"
}
Parameter |
Type |
Description |
---|---|---|
|
String |
Required, values: jwt |
|
String |
Required, values: {“user_id”: <author_id>} |
|
String |
Required |
|
String |
Required |
200 OK¶
{
"message": {
"id": "5b27aa52bd96bc0e3ec0eaf9",
"html": "<p>Hey hey!</p>",
"status": "proposed",
"talk_id": "post:123123:comments",
"author_id": 321321, // Corresponds to `author.owner_id`
"created_ts": 1435145454,
"updated_ts": 1435145454,
"parents": [],
"counts": {
"replies": {
"total": 0,
"direct": 0,
"public": {
"total": 0,
"direct": 0
}
}
}
},
"authors": [
{
"id": 123123,
"path": "community/trump/"
"title": "Donald Trump",
"image": "https://assets.rbl.ms/10301091/210x.png",
"about": "A short bio here...",
"rating": 3,
"owner_id": 321321
}
],
"reactions": [
{ ... }, // See "React to a message" endpoint
...
],
"admins": [
111,
222,
... // corresponds to `message.author_id`
]
}
Get Message¶
GET /core/v1/talks/<talk_id>/messages/<message_id>
Parameter |
Type |
Description |
---|---|---|
|
String |
Required |
|
String |
Required |
200 OK¶
{
"message": {
"id": "5b27aa52bd96bc0e3ec0eaf9",
"html": "<p>Hey hey!</p>",
"status": "proposed",
"talk_id": "post:123123:comments",
"author_id": 321321, // Corresponds to `author.owner_id`
"created_ts": 1435145454,
"updated_ts": 1435145454,
"parents": [],
"counts": {
"replies": {
"total": 0,
"direct": 0,
"public": {
"total": 0,
"direct": 0
}
}
}
},
"authors": [
{ ... }, // See "Create Message" endpoint
...
],
"reactions": [
{ ... }, // See "React to a message" endpoint
...
],
"admins": [
... // See "Create Message" endpoint
],
}
Update Message¶
POST /core/v1/talks/<talk_id>/messages/<message_id>
{
"changes": [
{"status": "<status>"},
{"text": "<text>"}
]
}
Parameter |
Type |
Description |
---|---|---|
|
String |
Required, values: jwt |
|
String |
Required, values: {“user_id”: <author_id or admin_id>} |
|
String |
Required |
|
String |
Required |
|
String |
Required for the change |
|
String |
Required for the change, values: proposed, rejected, approved, featured |
200 OK¶
{
"message": {
"id": "5b27aa52bd96bc0e3ec0eaf9",
"html": "This is new text",
"status": "featured",
"talk_id": "post:123123:comments",
"author_id": 321321, // Corresponds to `author.owner_id`
"created_ts": 1435145454,
"updated_ts": 1435145454,
"parents": [],
"counts": {
"replies": {
"total": 0,
"direct": 0,
"public": {
"total": 0,
"direct": 0
}
}
}
},
"authors": [
{ ... }, // See "Create Message" endpoint
...
],
"reactions": [
{ ... }, // See "React to a message" endpoint
...
],
"admins": [
... // See "Create Message" endpoint
],
}
Get Message Replies¶
GET /core/v1/talks/<talk_id>/messages/<message_id>/replies?order=<order>&limit=<limit>&offset=<offset>&excluded_ids=<excluded_ids>&mode=<mode>
Parameter |
Type |
Description |
---|---|---|
|
String |
Required |
|
String |
Required |
|
String |
Required, values: public, review, manage |
|
String |
Required, values: best, newest, oldest |
|
Integer |
Required |
|
Integer |
Required |
|
Comma-separated list of Strings |
Optional, values: message IDs |
200 OK¶
{
"message": {
"id": "5b27aa52bd96bc0e8e5aed1f",
"counts": {
"replies": {
"total": 1,
"direct": 1,
"public": {
"total": 0,
"direct": 0,
}
}
}
},
"replies": [
{ ... }, // See "Create Message" endpoint
...
],
"authors": [
{ ... }, // See "Create Message" endpoint
...
],
"reactions": [
{ ... }, // See "React to a message" endpoint
...
],
"admins": [
... // See "Create Message" endpoint
],
"bans": [
{ ... }, // See "Ban an author" endpoint
...
]
}
React on Message¶
POST /core/v1/talks/<talk_id>/messages/<message_id>/reactions
{
"reaction": "<reaction>"
}
DELETE /core/v1/talks/<talk_id>/messages/<message_id>/reactions
Parameter |
Type |
Description |
---|---|---|
|
String |
Required, values: jwt |
|
String |
Required, values: {“user_id”: <author_id>} |
|
String |
Required |
|
String |
Required |
|
String |
Required, values: like, dislike |
200 OK¶
{
"message": {
"id": "5b27aa52bd96bc0e3ec0eaf9",
"html": "<p>Hey hey!</p>",
"status": "proposed",
"talk_id": "post:123123:comments",
"author_id": 321321, // Corresponds to `author.owner_id`
"created_ts": 1435145454,
"updated_ts": 1435145454,
"parents": ["5b27aa52bd96bc0e8e5aed1f"],
"counts": {
"replies": {
"total": 0,
"direct": 0,
"public": {
"total": 0,
"direct": 0
}
}
}
},
"authors": [
{ ... }, // See "Create Message" endpoint
...
],
"reactions": [
{
"message_id": "5b27aa52bd96bc0e3ec0eaf9",
"reaction": "like" // Alternatives: "dislike"
}
],
"admins": [
... // See "Create Message" endpoint
]
}
Report Message¶
POST /core/v1/talks/<talk_id>/messages/<message_id>/reports
{
"reason": "<reason>",
"description": "<description>"
}
Parameter |
Type |
Description |
---|---|---|
|
String |
Required, values: jwt |
|
String |
Required, values: {“user_id”: <author_id>} |
|
String |
Required |
|
String |
Required |
|
String |
Required, values: spam, abuse, porno, violence, other |
|
String |
Optional |
200 OK¶
{
"report": {
"reason": "other", // Alternatives: "spam", "abuse", "porno", "violence"
"details": { # the content of `details` has no consistent structure
"acting_user_id": 12312,
"description": "some text here"
},
"created_ts": 1435145454
}
}
Get Message Reports¶
GET /core/v1/talks/<talk_id>/messages/<message_id>/reports
Parameter |
Type |
Description |
---|---|---|
|
String |
Required, values: jwt |
|
String |
Required, values: {“user_id”: <admin_id>} |
|
String |
Required |
|
String |
Required |
200 OK¶
{
"report": {
{ ... }, // See "Report Message" endpoint
...
}
}
Dashboard¶
Search Messages¶
GET /core/v1/talks/dashboard/messages?order=<order>&limit=<limit>&offset=<offset>&status=<status>&talk_id=<talk_id>&author_id=<author_id>
Parameter |
Type |
Description |
---|---|---|
|
String |
Required, values: jwt |
|
String |
Required, values: {“user_id”: <admin_id>} |
|
String |
Required, values: best, newest, oldest |
|
Integer |
Required |
|
Integer |
Required |
|
String |
Optional, values: proposed, rejected, approved, featured |
|
String |
Optional |
|
String |
Optional |
|
Comma-separated list of Strings |
Optional, values: message IDs |
200 OK¶
{
"messages": [
{ ... }, // See "Create Message" endpoint
...
],
"authors": [
{ ... }, // See "Create Message" endpoint
...
],
"bans": [
{"author_id": 123, "created_ts": 1275628975},
...
],
"counts": {
"messages": 26
},
}
Update Messages¶
POST /core/v1/talks/dashboard/messages?order=<order>&limit=<limit>&offset=<offset>&status=<status>&talk_id=<talk_id>&author_id=<author_id>
{
"changes": [
{"status": "<status>"},
{"text": "<text>"}
]
}
Parameter |
Type |
Description |
---|---|---|
|
String |
Required, values: jwt |
|
String |
Required, values: {“user_id”: <admin_id>} |
|
String |
Required, values: best, newest, oldest |
|
Integer |
Required |
|
Integer |
Required |
|
String |
Optional, values: proposed, rejected, approved, featured |
|
String |
Optional |
|
String |
Optional |
|
Comma-separated list of Strings |
Optional, values: message IDs |
|
String |
Required for the change |
|
String |
Required for the change, values: proposed, rejected, approved, featured |
200 OK¶
{}
Settings¶
Get Global Settings¶
GET /core/v1/talks/settings
Parameter |
Type |
Description |
---|---|---|
|
String |
Required, values: jwt |
|
String |
Required, values: {“user_id”: <admin_id>} |
200 OK¶
{
"settings": {
"review": {"is_enabled": true},
"rating": {"formula": "message_likes * 10 + replies_likes"},
"words_per_message": {"min": 0, "max": null},
"allowed_html_tags": ["p", "b", "i", "strong", "em"]
}
}
Set Global Settings¶
POST /core/v1/talks/settings
{
"settings": {
"review": {"is_enabled": false},
"rating": {"formula": "message_likes * 10 + replies_likes * 2"},
"words_per_message": {"min": 20, "max": 250},
"allowed_html_tags": ["p", "b", "i", "strong", "em", "a"]
}
}
Parameter |
Type |
Description |
---|---|---|
|
String |
Required, values: jwt |
|
String |
Required, values: {“user_id”: <admin_id>} |
200 OK¶
{
"settings": {
"review": {"is_enabled": false},
"rating": {"formula": "message_likes * 10 + replies_likes * 2"},
"words_per_message": {"min": 20, "max": 250},
"allowed_html_tags": ["p", "b", "i", "strong", "em", "a"]
}
}