Skip to content

Commit

Permalink
Merge pull request mozilla-bteam#36 from jasonLaster/patch-1
Browse files Browse the repository at this point in the history
Add a note on api_keys
  • Loading branch information
Jeff Griffiths authored Oct 7, 2017
2 parents 2397542 + e4436ed commit 8d158d0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bugzilla.getBug(678223, function(error, bug) {

# API
`bz.createClient(options)`
creates a new Bugzilla API client, optionally takes options like the REST API url, username + password, and timeout in milliseconds:
creates a new Bugzilla API client, optionally takes options like the REST API url, username + password or api_key, and timeout in milliseconds:

```javascript
var bugzilla = bz.createClient({
Expand All @@ -58,6 +58,17 @@ var bugzilla = bz.createClient({
});
```


```javascript
var bugzilla = bz.createClient({
url: "https://api-dev.bugzilla.mozilla.org/rest/",
api_key: "23dsf3423s",
timeout: 30000
});
```

See docs on the [login][bugzilla-login] endpoint.

### Client methods
Each method takes a callback that takes an error message (if any kind of error occurs) as its first argument, and the expected return data as its second.

Expand Down Expand Up @@ -112,3 +123,4 @@ retrieves a list of [suggested reviewers](https://wiki.mozilla.org/Bugzilla:BzAP
`getConfiguration(options, callback)`
gets the [configuration](https://wiki.mozilla.org/Bugzilla:REST_API:Objects:Configuration) of this Bugzilla server. Note: this only works currently against Mozilla's production instance, the bugzilla 5.0 instance running on landfill has no equivalent call that can be run from the browser due to a lack of CORS headers.

[bugzilla-login]: https://wiki.mozilla.org/Bugzilla:REST_API

0 comments on commit 8d158d0

Please sign in to comment.