@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

  )]}'
  {
    "ui": "TABLE"
  }

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

  {
    "ui": "TABLE"
  }

JSON Entities

PreferencesInfo

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

  • ui: The control that should be displayed on the change screen to render the labels/approvals. Possible values are DEFAULT and USER_LABEL_TABLE.

SEE ALSO

GERRIT

Part of Gerrit Code Review