Account confirmers, Anti-spam team, Confirmed users, Bureaucrats and Sysops emeriti
4,925
edits
m (moved Bugzilla:REST API:Calls to Bugzilla:REST API:Methods) |
No edit summary |
||
Line 8: | Line 8: | ||
=== Search for bugs (/bug GET) === | === Search for bugs (/bug GET) === | ||
''' | '''Arguments''' | ||
[[Bugzilla:REST_API:Search|Search parameters]], exactly as powerful as query.cgi but using the field names from the Bug object rather than those from the web interface. (At the moment, it does also support the field names from the web interface, to make it easy to port URLs and other code across. But if supporting this becomes difficult, it might go away.) | [[Bugzilla:REST_API:Search|Search parameters]], exactly as powerful as query.cgi but using the field names from the Bug object rather than those from the web interface. (At the moment, it does also support the field names from the web interface, to make it easy to port URLs and other code across. But if supporting this becomes difficult, it might go away.) | ||
''' | '''Response''' | ||
{ "bugs": [ <array of [[Bugzilla:REST_API:Objects#Bug|Bug]]> ] } | { "bugs": [ <array of [[Bugzilla:REST_API:Objects#Bug|Bug]]> ] } | ||
Line 25: | Line 25: | ||
=== Count bugs (/count GET) === | === Count bugs (/count GET) === | ||
''' | '''Arguments''' | ||
[[Bugzilla:REST_API:Search|Search parameters]], as above, plus zero or more of '''x_axis_field''', '''y_axis_field''' and '''z_axis_field'''. | [[Bugzilla:REST_API:Search|Search parameters]], as above, plus zero or more of '''x_axis_field''', '''y_axis_field''' and '''z_axis_field'''. | ||
''' | '''Response''' | ||
Counts of bugs, as a scalar, 1D, 2D or 3D array depending on how many axis_field parameters you specified. | Counts of bugs, as a scalar, 1D, 2D or 3D array depending on how many axis_field parameters you specified. | ||
Line 49: | Line 49: | ||
=== Create new bug (/bug POST) === | === Create new bug (/bug POST) === | ||
''' | '''Arguments''' | ||
[[Bugzilla:REST_API:Objects#Bug|Bug]], or part thereof, as POST body. The following fields are always compulsory: '''product''', '''component''', '''summary''' and '''version'''. The following fields may be compulsory depending on the configuration of your Bugzilla: '''description''', '''op_sys''', '''platform''', '''priority''' and '''severity'''. | [[Bugzilla:REST_API:Objects#Bug|Bug]], or part thereof, as POST body. The following fields are always compulsory: '''product''', '''component''', '''summary''' and '''version'''. The following fields may be compulsory depending on the configuration of your Bugzilla: '''description''', '''op_sys''', '''platform''', '''priority''' and '''severity'''. | ||
''' | '''Response''' | ||
201 Created status code, Location header pointing to new bug object. | 201 Created status code, Location header pointing to new bug object. | ||
Line 67: | Line 67: | ||
=== Retrieve bug (/bug/<id> GET) === | === Retrieve bug (/bug/<id> GET) === | ||
''' | '''Arguments''' | ||
* Bug ID on the URL | * Bug ID on the URL | ||
Line 75: | Line 75: | ||
* Multi-valued custom fields are not, in general, returned as arrays if there is 0 or 1 value. This is because I can't tell which custom fields are supposed to be multi-valued. As a hack, if your custom field name begins "cf_multi", it will get unconditionally array-ified. This limitation can only be lifted when the API is part of Bugzilla itself. | * Multi-valued custom fields are not, in general, returned as arrays if there is 0 or 1 value. This is because I can't tell which custom fields are supposed to be multi-valued. As a hack, if your custom field name begins "cf_multi", it will get unconditionally array-ified. This limitation can only be lifted when the API is part of Bugzilla itself. | ||
''' | '''Response''' | ||
[[Bugzilla:REST_API:Objects#Bug|Bug]]. | [[Bugzilla:REST_API:Objects#Bug|Bug]]. | ||
Line 88: | Line 88: | ||
=== Update bug (/bug/<id> PUT) === | === Update bug (/bug/<id> PUT) === | ||
''' | '''Arguments''' | ||
[[Bugzilla:REST_API:Objects#Bug|Bug]], or part thereof, as PUT body. | [[Bugzilla:REST_API:Objects#Bug|Bug]], or part thereof, as PUT body. | ||
''' | '''Response''' | ||
{ "ok": 1 } | { "ok": 1 } | ||
Line 115: | Line 115: | ||
=== List comments for bug (/bug/<id>/comment GET) === | === List comments for bug (/bug/<id>/comment GET) === | ||
''' | '''Arguments''' | ||
* Bug ID on the URL | * Bug ID on the URL | ||
* "new_since" DateTime parameter (YYYYMMDDTHHMMSS format only) returns only ones since date given. (3.4 or above only) | * "new_since" DateTime parameter (YYYYMMDDTHHMMSS format only) returns only ones since date given. (3.4 or above only) | ||
''' | '''Response''' | ||
{ "comments": [ array of [[Bugzilla:REST_API:Objects#Comment|Comment]] ] } | { "comments": [ array of [[Bugzilla:REST_API:Objects#Comment|Comment]] ] } | ||
Line 137: | Line 137: | ||
=== Add new comment to bug (/bug/<id>/comment POST) === | === Add new comment to bug (/bug/<id>/comment POST) === | ||
''' | '''Arguments''' | ||
[[Bugzilla:REST_API:Objects#Comment|Comment]] as POST body. | [[Bugzilla:REST_API:Objects#Comment|Comment]] as POST body. | ||
''' | '''Response''' | ||
201 Created status code, Location header pointing to bug/<id>/comment (as individual comments don't have their own location). | 201 Created status code, Location header pointing to bug/<id>/comment (as individual comments don't have their own location). | ||
Line 156: | Line 156: | ||
=== List history for bug (/bug/<id>/history GET) === | === List history for bug (/bug/<id>/history GET) === | ||
''' | '''Arguments''' | ||
* Bug ID on the URL. | * Bug ID on the URL. | ||
''' | '''Response''' | ||
{ "history": [ array of [[Bugzilla:REST_API:Objects#ChangeSet|ChangeSet]] ] } | { "history": [ array of [[Bugzilla:REST_API:Objects#ChangeSet|ChangeSet]] ] } | ||
Line 175: | Line 175: | ||
=== List flags for bug (/bug/<id>/flag GET) === | === List flags for bug (/bug/<id>/flag GET) === | ||
''' | '''Arguments''' | ||
* Bug ID on the URL. | * Bug ID on the URL. | ||
''' | '''Response''' | ||
{ "flags": [ array of [[Bugzilla:REST_API:Objects#Flag|Flag]] ] } | { "flags": [ array of [[Bugzilla:REST_API:Objects#Flag|Flag]] ] } | ||
Line 195: | Line 195: | ||
=== List attachments for bug (/bug/<id>/attachment GET) === | === List attachments for bug (/bug/<id>/attachment GET) === | ||
''' | '''Arguments''' | ||
* Bug ID on the URL. | * Bug ID on the URL. | ||
* attachmentdata=1 does the obvious thing. | * attachmentdata=1 does the obvious thing. | ||
''' | '''Response''' | ||
{ "attachments": [ array of [[Bugzilla:REST_API:Objects#Attachment|Attachment]] ] } | { "attachments": [ array of [[Bugzilla:REST_API:Objects#Attachment|Attachment]] ] } | ||
Line 215: | Line 215: | ||
=== Create new attachment (/bug/<id>/attachment POST) === | === Create new attachment (/bug/<id>/attachment POST) === | ||
''' | '''Arguments''' | ||
[[Bugzilla:REST_API:Objects#Attachment|Attachment]] as POST body. | [[Bugzilla:REST_API:Objects#Attachment|Attachment]] as POST body. | ||
''' | '''Response''' | ||
201 Created status code, Location header pointing to new object. | 201 Created status code, Location header pointing to new object. | ||
Line 234: | Line 234: | ||
=== Retrieve attachment (/attachment/<id> GET) === | === Retrieve attachment (/attachment/<id> GET) === | ||
''' | '''Arguments''' | ||
* Attachment ID on the URL. | * Attachment ID on the URL. | ||
* attachmentdata=1 does the obvious thing. | * attachmentdata=1 does the obvious thing. | ||
''' | '''Response''' | ||
[[Bugzilla:REST_API:Objects#Attachment|Attachment]]. | [[Bugzilla:REST_API:Objects#Attachment|Attachment]]. | ||
Line 251: | Line 251: | ||
=== Update attachment metadata (/attachment/<id> PUT) === | === Update attachment metadata (/attachment/<id> PUT) === | ||
''' | '''Arguments''' | ||
[[Bugzilla:REST_API:Objects#Attachment|Attachment]] as PUT body. | [[Bugzilla:REST_API:Objects#Attachment|Attachment]] as PUT body. | ||
''' | '''Response''' | ||
{ "ok": 1 } | { "ok": 1 } | ||
Line 271: | Line 271: | ||
=== Search for users (/user GET) === | === Search for users (/user GET) === | ||
''' | '''Arguments''' | ||
* "match" parameter with string to match against either name or real_name. | * "match" parameter with string to match against either name or real_name. | ||
''' | '''Response''' | ||
{ users: [ array of [[Bugzilla:REST_API:Objects#User|User]] ] } | { users: [ array of [[Bugzilla:REST_API:Objects#User|User]] ] } | ||
Line 289: | Line 289: | ||
=== Retrieve user (/user/<id> GET) === | === Retrieve user (/user/<id> GET) === | ||
''' | '''Arguments''' | ||
User ID on the URL. Can be numeric ID or email address. | User ID on the URL. Can be numeric ID or email address. | ||
''' | '''Response''' | ||
[[Bugzilla:REST_API:Objects#User|User]]. | [[Bugzilla:REST_API:Objects#User|User]]. | ||
Line 308: | Line 308: | ||
=== Configuration (/configuration GET) === | === Configuration (/configuration GET) === | ||
''' | '''Arguments''' | ||
* None | * None | ||
''' | '''Response''' | ||
[[Bugzilla:REST_API:Objects:Configuration|Configuration]] | [[Bugzilla:REST_API:Objects:Configuration|Configuration]] |