Skip to content

Instantly share code, notes, and snippets.

@ottonomy
ottonomy / SelfIssuedSkillCredential.json
Last active April 11, 2024 23:01
Basic OB examples for skills and work history
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"
],
"id": "urn:uuid:8468ceb1-8ef7-4c42-b69d-078a8b8bba7c",
"type": ["VerifiableCredential", "OpenBadgeCredential"],
"issuer": "did:example:me",
"validFrom": "2020-01-01T00:00:00Z",
"validUntil": "2024-01-01T00:00:00Z",
@ottonomy
ottonomy / README.md
Created July 19, 2019 19:43
Query Badgr API for Expired Assertions

Badgr API Example: Querying for expired assertions

Notifications and related UX around expired or soon-to-expire badges will be available as a Badgr Pro feature soon. In the meantime, intrepid API clients may implement their own custom behavior around notifications by processing awarded assertions to determine which are expired.

Instructions for use

  • Download the files to a directory on your local system.
  • Activate a virtualenvironment for dependencies
@ottonomy
ottonomy / CourseObject.json
Created February 19, 2019 19:35
CourseObject with alternate identifiers
{
"@context": ["https://tbd.example.com/edplan/v1", {"coci_id": "https://www.cccco.edu/terms/#coci_id"}],
"id": "https://someschool.edu/courses/123",
"name": "Math for Nursing",
"coci_id": "CCC000037611"
}
import json
import requests
def add_assertion(access_token, badgeclass_entity_id, data):
import pdb; pdb.set_trace();
headers = {'Authorization': "Bearer " + access_token}
url = "https://api.badgr.io/v2/badgeclasses/{}/assertions".format(badgeclass_entity_id)
response = requests.request('POST', url, headers=headers, timeout=15, json=data)
print response.text
content = json.loads(response.text)
@ottonomy
ottonomy / recipientProfileContext.json
Last active March 2, 2018 18:17
Draft Recipient Profile Extension
{
"@context": {
"obi": "https://w3id.org/openbadges#",
"extensions": "https://w3id.org/openbadges/extensions#",
"schema": "http://schema.org/",
"name": "schema:name",
"id": "@id"
},
"obi:validation": [
{
"@context": ["http://purl.imsglobal.org/ctx/caliper/v1p1", "https://w3id.org/openbadges/v2", "https://gist.githubusercontent.com/ottonomy/e04c820dbfacec121c9e8f7dbd45b678/raw/16e33d8d9c75263409d478bfc80e103000d1fd2a/openbadges-profile-context.json"],
"type": "MessageEvent",
"actor": {
"id": "https://api.badgr.io/users/1iHwxOESQ_iOR_zHReMEdQ",
"type": "Profile"
},
"action": "Applied",
"object": {
"id": "http://digitalpromise.ws/applications/abc123",
@ottonomy
ottonomy / keybase.md
Created August 18, 2017 18:29
keybase.md

Keybase proof

I hereby claim:

  • I am ottonomy on github.
  • I am ottonomy (https://keybase.io/ottonomy) on keybase.
  • I have a public key ASDTyXWjgypURfgap4S5UUp3QYLXqWAHcNN71FyHthF85Qo

To claim this, I am signing this object:

{
"@context": "https://example.org/contexts/pathways.json",
"@id": "https://example.org/cbu/pathways/korean/basic-korean/elements/basic-korean",
"@type": "PathwayElement",
"targetName": "Basic Korean",
"targetDescription": "Learner demonstrates foundational comprehension of Korean language, including reading, writing, and the essential conversational skills for an extended stay in Korea.",
"alignmentUrl": "https://languages.example.com/korean/basic-knowledge",
"targetCode": null,
"completionBadge": "https://example.org/cbu/badges/korean/basic-korean",
"numberBadgesRequired": 1,
@ottonomy
ottonomy / displayer-requirements.md
Last active July 28, 2017 21:43
Open Badges Displayer Requirements for Verification

Proposed Requirement: Must display that the Open Badge is an Open Badge

Requirement: Must enable the viewer to initiate verification of the displayed Open Badge and retrieve up-to-date results about its validity.

Details:

  • Must allow a viewer to access a known verification service with input data in hand.
  • Input data may be in the form of a baked badge image, the assertion URL of a hosted-verification Assertion, or the signed JSON string for a signed-verification Assertion.

Recommended Practice:

  • Make user profile information available to the viewer of the Candidate Platform consistent with the privacy wishes expressed by the user who is recipient of the badge, when relevant.
@ottonomy
ottonomy / 20170621-issuer.json
Last active June 21, 2017 16:57
20170621-issuer.json
{
"@context": "https://w3id.org/openbadges/v2",
"id": "https://gist.github.com/ottonomy/92d945eb61bc820d0954b45fd66836c6/raw",
"type": "Issuer",
"name": "First! American Civics 2016",
"url": "http://concentricsky.com",
"telephone": "+15415551212",
"description": "A test issuer for a hypothetical high school civics course",
"image": "https://api.badgr.io/public/issuers/american-civics-2016/image",
"email": "ottonomy+demo@gmail.com"