This page describes the REST endpoints that are added by the @PLUGIN@ plugin.
Please also take note of the general information on the REST API.
GET /config/server/@PLUGIN@~projects/{project-name}/remotes/
List existing webhooks for a project.
GET /config/server/@PLUGIN@~projects/myProject/remotes/
As result a map is returned that maps remote name to RemoteInfo entity.
  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json; charset=UTF-8
  )]}'
  {
    "foo": {
      "url" : "https://foo.org/gerrit-events",
      "maxTries" : 3,
      "sslVerify": true
    },
    "bar": {
      "url" : "https://bar.org/",
      "events" : ["patchset-created", "ref-updated"]
    }
  }
GET /config/server/@PLUGIN@~projects/{project-name}/remotes/[{remote-name}]
Get information about one webhook.
GET /config/server/@PLUGIN@~projects/myProject/remotes/foo
As result a RemoteInfo entity is returned.
  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json; charset=UTF-8
  )]}'
  {
    "url" : "https://foo.org/gerrit-events",
    "maxTries" : 3,
    "sslVerify": true
  }
PUT /config/server/@PLUGIN@~projects/{project-name}/remotes/[{remote-name}]
Create or update a webhook for a project. The request body needs to include a RemoteInfo entity.
  PUT /config/server/@PLUGIN@~projects/myProject/remotes/foo
  Content-Type: application/json; charset=UTF-8
  {
    "url" : "https://foo.org/gerrit-events",
    "maxTries" : "3",
    "sslVerify": "true"
  }
As response a RemoteInfo entity, which describes the created/updated webhook, is returned.
  HTTP/1.1 201 Created
  Content-Disposition: attachment
  Content-Type: application/json; charset=UTF-8
  )]}'
  {
    "url" : "https://foo.org/gerrit-events",
    "maxTries" : 3,
    "sslVerify": true
  }
The response code is 200 when the webhook already existed and was updated:
  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json; charset=UTF-8
  )]}'
  {
    "url" : "https://foo.org/gerrit-events",
    "maxTries" : 3,
    "sslVerify": true
  }
DELETE /config/server/@PLUGIN@~projects/{project-name}/remotes/[{remote-name}]
Delete a webhook for a project.
DELETE /config/server/@PLUGIN@~projects/myProject/remotes/foo
HTTP/1.1 204 No Content
The RemoteInfo contains information about a remote section in a webhooks.config file.