Closed andrewhayward closed 7 years ago
@cmcavoy do we want to have the issuers have programs, programs have badges data model moving forward? Didn't that feel limiting with CEM and so forth?
@threeqube worth thinking about, but not sure what an alternative is. If anything, the top level issuer needs more power if we're going to go multi-tenant in a bigger way (where tenants become whole city programs).
Moving to archive.
API v3 (candidate)
I'm posting this now, as a WIP, so it's at least out there, rather than sitting on my machine. Feel free to ignore, or dig in and tell me it's all wrong before it gets too late!
Introduction
This documentation describes a candidate for the Open Badger API (OBr), version 3. This version of the API takes lessons learned from both previous versions, uniting them into into a more rounded, general purpose suite.
Security Model
[TO DO]
Data
Issuers
[TO DO] This is not complete.
name
- the name of the issuer. Required when creating new issuers. Will be present in all relevant requests.shortname
- the issuer's slug, as used in API requests. Not allowed when creating new issuers (inferred from URL).url
- the issuer's URL.image
- a URL pointing at a graphical representation of the issuer.strapline
- a short, one-line description of the issuer.description
- a longer description of the issuer. Required when creating new issuers. May contain HTML.location
- the canonical location of the issuer in the API. Not allowed when creating new issuers (inferred). Will be present in all relevant requests.meta
- a meta object.Examples
Creating
Retrieving
Programs
[TO DO] This is probably not complete.
name
- the name of the program. Required when creating new programs. Will be present in all relevant requests.shortname
- the program's slug, as used in API requests. Not allowed when creating new programs.url
- the program's URL.image
- a URL pointing at a graphical representation of the program.strapline
- a short, one-line description of the program.description
- a longer description of the program. Required when creating new programs. May contain HTML.location
- the canonical location of the program in the API. Not allowed when creating new programs. Will be present in all relevant requests.issuer
- an abbreviated Issuer object, describing the issuer associated with this program. Not allowed when creating new programs.meta
- a Meta object.Examples
Creating
Retrieving
Badges
[TO DO] This is probably not complete.
name
- the name of the badge. Required when creating new programs. Will be present in all relevant requests.shortname
- the badge's slug, as used in API requests. Not allowed when creating new badges.url
- the badge's URL.image
- a URL pointing at a graphical representation of the badge. Required when creating new badges. Must be a PNG.strapline
- a short, one-line description of the badge.description
- a longer description of the badge. Required when creating new badges. May contain HTML.criteria
- a description of what an earner should be able to do having been awarded this badge. May contain HTML.location
- the canonical location of the badge in the API. Not allowed when creating new badges. Will be present in all relevant requests.issuer
- an abbreviated Issuer object, describing the issuer associated with this badge. Not allowed when creating new badges.program
- an abbreviated Program object, describing the program associated with this badge. Not allowed when creating new badges.meta
- a Meta object.Examples
Creating
Retrieving
Meta
A namespaced JSON data blob, with optional schemas.
Global Response Information
Parameters
Every API request will have the following response parameters in common:
status
- Status of the request. If the request is good, contains the literal string "ok". If the request is bad for any reason, contains the literal string "error".error
- If the request is bad for any reason, contains details of the error:message
- A human readable message describing the error.code
- A code representing the type of error.For paginatable requests, the following response parameters are also shared:
page
- The page being returned.pages
- The number of available pages.pageSize
- The number of results being returned per page.total
- The total number of results available.previous
- URL pointing to previous page of results, if that page exists.next
- URL pointing to next page of results, if that page exists.Headers
For paginatable requests, the following response headers are provided:
Link: <URL>; rel=previous
(where a previous page exists).Link: <URL>; rel=next
(where a next page exists).Endpoints
/v3/data/:issuer
GET
POST
PUT
PATCH
DELETE
GET
POST
PUT
PATCH
DELETE
GET
POST
PUT
PATCH
DELETE
GET
GET
POST
POST
GET
POST
POST
GET
GET
GET (Paginatable)
/v3/issuers/:issuer
GET
/v3/programs
GET (Paginatable)
/v3/programs/:program
GET
/v3/badges
GET (Paginatable)
/v3/badges/:badge
GET