@PLUGIN@ - /accounts/ REST API

This page describes the ‘/accounts/’ REST endpoints that are added by the @PLUGIN@ plugin.

Please also take note of the general information on the REST API.

@PLUGIN@ Endpoints

Get Preferences

GET /accounts/{account-id}/@PLUGIN@~preferences

Gets the preferences of a user for the @PLUGIN@ plugin.

Request

  GET /accounts/self/@PLUGIN@~preferences HTTP/1.0

As response a PreferencesInfo entity is returned that contains the preferences of a user for the @PLUGIN@ plugin.

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8

  )]}'
  {
    "review_strategy": "BLIND"
  }

Put Preferences

PUT /accounts/{account-id}/@PLUGIN@~preferences

Sets the user preferences for the @PLUGIN@ plugin.

The new preferences must be specified as a PreferenceInfo entity in the request body. Not setting a parameter means that the parameters are set to the defaults.

Request

  PUT /accounts/self/@PLUGIN@~preferences HTTP/1.0
  Content-Type: application/json;charset=UTF-8

  {
    "review_strategy": "BLIND"
  }

JSON Entities

PreferencesInfo

The PreferencesInfo entity contains the preferences of the @PLUGIN@ plugin.

  • review_strategy: The control that should be displayed on preferences screen to change the review strategy. Possible values are DEFAULT and BLIND.

SEE ALSO

GERRIT

Part of Gerrit Code Review