API equivalent for status badge

api

#1

Currently, there does not seem to be a way to ask the Circle API what the build status is of a project with only a build status token. That category of token seems to only work for fetching badge images, not reading anything from the API.

For example this successfully retrieves a badge image for a private project, using a build status token.
https://circleci.com/gh/sitecues/sitecues-core.svg?style=svg&circle-token=acc2259949dc35d324ffff96186e5874a4b1ef4f

This simply returns “Permission denied”.
https://circleci.com/api/v1.1/project/github/sitecues/sitecues-core?circle-token=acc2259949dc35d324ffff96186e5874a4b1ef4f&limit=1&filter=completed

Full API tokens work, of course. But the idea here is to share only limited access publicly, just to the build status. Basically the same as a badge image, only in JSON form.

Use case: I want to use shields.io to show the build status of my private projects. Not only are their status badges very nice, but they provide more options and file formats.

We tried to make this happen, but it appears the Circle API won’t give up the goods when provided a build status token. Using any other kind of token is unsafe for this use case.

For details, see: badges/shields#798 (comment)


#2