Openbadges.getCollections()

Querying for Badge Groups

Once you have the earner's Backpack user ID, you can query for their public badge groups.

Usage

Hover over inputs/exits for more info.

var Openbadges = require('machinepack-openbadges');


// Querying for Badge Groups

Openbadges.getCollections({

uid: 125363,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Could not find a collections by the Backpack user ID

collesionsNotFound: function (result) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

uid required

Backpack user ID

125363

Exits

error

An unexpected error occurred.

collesionsNotFound

Could not find a collections by the Backpack user ID

{ status: 404,
  headers: '{"Accepts":"application/json"}',
  body: '{"httpStatus":404,"status":"missing"}' }
success

OK.

{ status: 200,
  headers: '{"Accepts":"application/json"}',
  body: '{"userId":125363,"groups":[{"groupId":45690,"name":"Javascript","badges":11}...]}' }