Bugzilla:REST API: Difference between revisions

Line 82: Line 82:
====with two factor authentication====
====with two factor authentication====


If you have two factor authentication on your Bugzilla account (which you should), then you will not be able to call the login endpoint. Instead [https://bugzilla.mozilla.org/userprefs.cgi?tab=apikey create a new API key]. Then that API key can be passed as a token. For example in Python:
If you have two factor authentication on your Bugzilla account (which is recommended), then you will not be able to call the login endpoint. Instead [https://bugzilla.mozilla.org/userprefs.cgi?tab=apikey create a new API key]. Then that API key can be passed as a token. For example in Python:


>>> r = requests.get('https://bugzilla.mozilla.org/rest/bug', params={'id': '1214433', 'token': 'the-api-key-from-the-bugzilla-userprefs-page'})
>>> r = requests.get('https://bugzilla.mozilla.org/rest/bug', params={'id': '1214433', 'token': 'the-api-key-from-the-bugzilla-userprefs-page'})
>>> print res.json()['bugs'][0]['id']
>>> print res.json()['bugs'][0]['id']


[[category:Bugzilla]]
[[category:Bugzilla]]
Confirmed users
1,158

edits