Skip to contents

Create a user block

Usage

osm_create_user_block(
  user_id,
  reason,
  period,
  needs_view = FALSE,
  format = c("R", "xml", "json")
)

Arguments

user_id

Blocked user id.

reason

Reason for block shown to the blocked user (markdown text).

period

Block duration in hours between 0 and maximum block period, currently 87660.

needs_view

If TRUE, the user is required to view the block page for the block to be lifted. Default to FALSE.

format

Format of the output. Can be "R" (default), "xml", or "json".

Value

Same format as osm_get_user_blocks()

See also

Other user blocks' functions: osm_get_user_blocks(), osm_list_active_user_blocks()

Other functions for moderators: osm_delete_note(), osm_hide_comment_changeset_discussion(), osm_redaction_object()

Examples

if (FALSE) { # \dontrun{
set_osmapi_connection("testing") # use the testing server

my_user_id <- osm_details_logged_user()$user["id"]
osm_create_user_block(user_id = my_user_id, reason = "Not really evil, just testing.", period = 0)
} # }