Account confirmers, Anti-spam team, Confirmed users, Bureaucrats and Sysops emeriti
4,925
edits
No edit summary |
|||
| Line 39: | Line 39: | ||
As the API is tweaked and revised, the version number in these URLs will increase, so updates don't break every single client immediately. However, old versions are not guaranteed to persist. Authors of API-using tools are strongly encouraged to join the [http://www.mozilla.org/community/developer-forums.html#tools mozilla.tools] mailing list to be kept up to date. | As the API is tweaked and revised, the version number in these URLs will increase, so updates don't break every single client immediately. However, old versions are not guaranteed to persist. Authors of API-using tools are strongly encouraged to join the [http://www.mozilla.org/community/developer-forums.html#tools mozilla.tools] mailing list to be kept up to date. | ||
==Browse Interface== | |||
If the Accept: header of a request is set to text/html (as it is by an ordinary web browser) then the API will return YAML-HTML, which the browser can display. In other words, you can play with the API using just your browser and see results in a human-readable form. [https://api-dev.bugzilla.mozilla.org/latest/bug/35 Here is an example]. This is a good way to try out various calls and capabilities. | |||
== Authentication == | == Authentication == | ||
| Line 96: | Line 100: | ||
'''Notes''' | '''Notes''' | ||
* Only a subset of a bug's fields are returned on a search. These are those in bold on the [[Bugzilla:REST_API:Objects#Bug|list]]. As a rule of thumb, only single-valued fields are returned. | * Examples: [https://api-dev.bugzilla.mozilla.org/latest/bug?product=Bugzilla&priority=P1&severity=blocker all P1 blockers in the Bugzilla product], [https://api-dev.bugzilla.mozilla.org/latest/bug?changed_after=1h all bugs changed in the last hour]. | ||
* Only a subset of a bug's fields are returned on a search. These are those in bold on the [[Bugzilla:REST_API:Objects#Bug|list]]. As a rule of thumb, only single-valued fields are returned. As a workaround, you can get full bugs by specifying '''only''' bug IDs as the search criteria (see the documentation for /bug/<id> GET). | |||
'''Errors''' | '''Errors''' | ||
| Line 134: | Line 139: | ||
'''Notes''' | '''Notes''' | ||
* Examples: [https://api-dev.bugzilla.mozilla.org/latest/bug/35 bug 35], [https://api-dev.bugzilla.mozilla.org/latest/bug/350001?comments=1&attachmentdata=1&history=1 bug 350001 with all comments, attachments and history]. | |||
* If you want to retrieve multiple [[Bugzilla:REST_API:Objects#Bug|Bug]]s at once, use the Search interface and specify only Bug IDs as your search criteria. You will be returned full [[Bugzilla:REST_API:Objects#Bug|Bug]] objects instead of the reduced number of fields normally presented on a Search. This is a shortcut to avoid people having to make 20 calls to get 20 full bug objects. | * If you want to retrieve multiple [[Bugzilla:REST_API:Objects#Bug|Bug]]s at once, use the Search interface and specify only Bug IDs as your search criteria. You will be returned full [[Bugzilla:REST_API:Objects#Bug|Bug]] objects instead of the reduced number of fields normally presented on a Search. This is a shortcut to avoid people having to make 20 calls to get 20 full bug objects. | ||
| Line 179: | Line 185: | ||
'''Notes''' | '''Notes''' | ||
* Example: [https://api-dev.bugzilla.mozilla.org/latest/bug/350001/comment bug 350001 comments]. | |||
* No comments (or none you can see) -> empty array. | * No comments (or none you can see) -> empty array. | ||
| Line 218: | Line 225: | ||
'''Notes''' | '''Notes''' | ||
* Example: [https://api-dev.bugzilla.mozilla.org/latest/bug/350001/history bug 350001 history]. | |||
* This call requires Bugzilla 3.4 or above. | * This call requires Bugzilla 3.4 or above. | ||
| Line 235: | Line 243: | ||
'''Notes''' | '''Notes''' | ||
* Example: [https://api-dev.bugzilla.mozilla.org/latest/bug/500004/flag bug 500004 flags]. | |||
'''Errors''' | '''Errors''' | ||
| Line 255: | Line 265: | ||
'''Notes''' | '''Notes''' | ||
* Examples: [https://api-dev.bugzilla.mozilla.org/latest/bug/500004/attachment bug 500004 attachments], [https://api-dev.bugzilla.mozilla.org/latest/bug/350001/attachment?attachmentdata=1 bug 350001 attachments with data]. | |||
* No attachments -> empty array. | * No attachments -> empty array. | ||
| Line 290: | Line 301: | ||
'''Notes''' | '''Notes''' | ||
* Examples: [https://api-dev.bugzilla.mozilla.org/latest/attachment/235466?content-type=text/html attachment 235466], [https://api-dev.bugzilla.mozilla.org/latest/attachment/386129?attachmentdata=1 attachment 386129 with attachment data]. | |||
'''Errors''' | '''Errors''' | ||
| Line 324: | Line 337: | ||
'''Notes''' | '''Notes''' | ||
* Examples: not possible as this API requires the user to be logged in. | |||
* No matches -> empty array. | * No matches -> empty array. | ||
* This call requires Bugzilla 3.4 or above. | * This call requires Bugzilla 3.4 or above. | ||
| Line 341: | Line 355: | ||
'''Notes''' | '''Notes''' | ||
* Example: [https://api-dev.bugzilla.mozilla.org/latest/user/gerv@mozilla.org user 'gerv@mozilla.org']. | |||
* This call requires Bugzilla 3.4 or above. | * This call requires Bugzilla 3.4 or above. | ||
| Line 359: | Line 374: | ||
'''Notes''' | '''Notes''' | ||
* Example: [https://api-dev.bugzilla.mozilla.org/latest/configuration b.m.o. configuration]. | |||
* flags=0 parameter removes flag-related information from the config; because flags can be enabled or disabled per-component, there is a lot of flag-related info and so this cuts down the size significantly. However, you will not be able to add new flags to bugs or attachments without this info. | * flags=0 parameter removes flag-related information from the config; because flags can be enabled or disabled per-component, there is a lot of flag-related info and so this cuts down the size significantly. However, you will not be able to add new flags to bugs or attachments without this info. | ||