Skip to content

Instantly share code, notes, and snippets.

@toolness
Created September 11, 2013 18:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toolness/6527882 to your computer and use it in GitHub Desktop.
Save toolness/6527882 to your computer and use it in GitHub Desktop.
Workshopper Remote Verification API Proposal

The Workshopper Remote Verification API is a simple API that allows clients to provide solutions for Workshopper problems to remote websites, and potentially receive Open Badges in response.

The remote website can implement its own verification policies. For instance, a site that trusts its users can simply accept solutions without question, or it can actually execute the code in a sandbox, or it can queue the solution for review by a human.

POST /credit

All requests to this endpoint are expected to contain an Authorization header using the Bearer authentication scheme described in IETF RFC 6750. For example:

POST /credit HTTP/1.1
Authorization: Bearer mF_9.B5f-4.1JqM

{
  "package": {
    "name": "levelmeup",
    "version": "0.0.10"
  },
  "problem": "all_your_base",
  "solution": <source code of solution>
}

RESPONSE:

If the solution is not OK, you get:

  HTTP/1.1 409 Conflict
  Content-Type: application/json
  
  {
    "status": "rejected"
  }

If the solution will take time to evaluate, you get:

  HTTP/1.1 202 Accepted
  Content-Type: application/json

  {
    "status": "pending",
    "url": "http://url/to/status"
  }

If the solution is OK, you get:

  HTTP/1.1 200 OK
  Content-Type: application/json

  {
    "status": "accepted"
  }

If you also get a badge, the response has a badge key, like this:

  {
    "status": "accepted",
    "badge": {
      "name": "Level Me Up!",
      "url": "http://url/to/badge",                // Human-readable web page
      "assertion_url": "http://url/to/badge.json"
    }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment