Shields: Mozilla Addon API URL Broken

Created on 22 Feb 2019  路  7Comments  路  Source: badges/shields

I noticed the Firefox Addon badges were broken on my project's README.md so I did some digging.

On line 6083 of shields/server.js I noticed:

 var url = 'https://services.addons.mozilla.org/api/1.5/addon/' + addonId;

According to Mozilla Add-ons Manager API:

This API is deprecated and we do not recommend projects use this API

It looks like all of the examples included on that page are broken as well.

There were no other posts tagged AMO API on the MDN webdocs

Is there another solution that would make these Mozilla badges functional again?

bug good first issue needs-upstream-help service-badge

All 7 comments

Hi! Thanks for the report.

Our tests picked this up about 12 hours ago as well: https://circleci.com/gh/badges/daily-tests/167

Would you be up for reaching out to them and politely asking if there's a new API Shields could use?

I opened Bugzilla Bug 1530021 to track this issue

Bugzilla Bug 1530021 closed stating AMO issues are tracked on the Mozilla Addons Server repository

Created Issue 10767 on the Mozilla Addons Server repository to track this issue.

Response/Resolution for Issue 10767:

Hi,
These APIs have been deprecated for a very long time and were never really meant for outside consumption ; We finally removed them during our last push after noting that there wasn't that much traffic to them anymore.
The latest, fully supported API is documented over at https://addons-server.readthedocs.io/en/latest/topics/api/index.html (use https://addons-server.readthedocs.io/en/latest/topics/api/v3_legacy/index.html if you want some stability).

Thanks for following up with the details! The silver lining here is that our service classes for these badges has already been refactored (https://github.com/badges/shields/blob/master/services/amo/amo-base.js#L18)

So getting these badges working again should just be a matter of determining which API(s) are needed, and then updating the API url and schema accordingly

Awesome!

I got the following to return information similar to what was previously used:

'https://addons.mozilla.org/api/v3/addons/addon/' + addonId

Example:
https://addons.mozilla.org/api/v3/addons/addon/sputnik-osint/

Nice! If anyone wants to take a crack at updating this I'd be happy to review and merge a PR.

Was this page helpful?
0 / 5 - 0 ratings