Skip to content

broadcast_ops_communities ​

To interact with the communities framework, use custom_json operations with the an id of community. Communities also intepret other ids like follow and reblog.

See: communities.md

Also see: Bridge, Broadcast Transaction, custom_json

setRole ​

Sets a role for a given account in a community.

  • Owner can set any role.
  • Admins can set the role of any account to any level below admin, except for other Admins.
  • Mods can set the role of any account to any level below mod, except for other Mods.

Roles: posting

PARAMS
json
[
  "community",
  "account",
  "role"
]
EXAMPLES
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"setRole\", {\"community\": \"hive-123456\", \"account\": \"bob\", \"role\": \"admin\"}]"
  }
]
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"setRole\", {\"community\": \"hive-123456\", \"account\": \"charlie\", \"role\": \"mod\"}]"
  }
]
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"setRole\", {\"community\": \"hive-123456\", \"account\": \"dave\", \"role\": \"guest\"}]"
  }
]
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"setRole\", {\"community\": \"hive-123456\", \"account\": \"edward\", \"role\": \"member\"}]"
  }
]

setUserTitle ​

Sets a title (badge) for a given account in a community (Mods or higher).

Roles: posting

PARAMS
json
[
  "community",
  "account",
  "title"
]
EXAMPLE
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"setUserTitle\", {\"community\": \"hive-123456\", \"account\": \"alice\", \"title\": \"Founder\"}]"
  }
]

mutePost ​

Mute a post (Mods or higher). Can be a topic or a comment.

Note: Any posts muted for spam should contain simply the string spam in the notes field. This standardized label will help train automated spam detection.

EXAMPLE
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"mutePost\",{\"community\":\"hive-123456\",\"account\":\"eve\",\"permlink\":\"re-eve-comment-1564339652z\",\"notes\":\"Off Topic\"}]"
  }
]

unmutePost ​

Unmute a post (Mods or higher).

EXAMPLE
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"unmutePost\",{\"community\":\"hive-123456\",\"account\":\"eve\",\"permlink\":\"re-eve-comment-1564339652z\",\"notes\":\"On Topic (on second thought)\"}]"
  }
]

updateProps ​

EXAMPLE
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"updateProps\",{\"community\":\"hive-123456\",\"props\":{\"title\":\"Anti-Knitting\",\"about\":\"A community against knitting.\",\"is_nsfw\":false,\"description\":\"If you like to knitting, go away.\",\"flag_text\":\"Must hate knitting or else you will be muted.\"}}]"
  }
]

subscribe ​

Allows a user to signify they want this community shown on their personal trending feed and to be shown in their navigation menu.

EXAMPLE
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"subscribe\",{\"community\":\"hive-123456\"}]"
  }
]

pinPost ​

Stickies a post to the top of the community homepage (Mods or higher). If multiple posts are stickied, the newest ones are shown first.

EXAMPLE
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"pinPost\",{\"community\":\"hive-123456\",\"account\":\"alice\",\"permlink\":\"a-post-by-alice\"}]"
  }
]

unsubscribe ​

Allows a user to signify they no longer want this community shown on their personal trending feed or to be shown in their navigation menu.

EXAMPLE
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"unsubscribe\",{\"community\":\"hive-123456\"}]"
  }
]

unpinPost ​

Removes a post to the top of the community homepage (Mods or higher).

EXAMPLE
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"unpinPost\",{\"community\":\"hive-123456\",\"account\":\"alice\",\"permlink\":\"a-post-by-alice\"}]"
  }
]

flagPost ​

Used by guests to suggest a post for the review queue. It's up to the community to define what constitutes flagging.

EXAMPLE
json
[
  "custom_json",
  {
    "required_auths": [],
    "required_posting_auths": [
      "alice"
    ],
    "id": "community",
    "json": "[\"flagPost\",{\"community\":\"hive-123456\",\"account\":\"eve\",\"permlink\":\"a-post-by-eve\",\"notes\":\"Warning\"}]"
  }
]