Skip to content

ezpaarse-project/ezpaarse-badge

Repository files navigation

ezPAARSE-Badge

Build Status Docker stars Docker Pulls

Node.js server using OpenBadgeFactory API

Requirements

  • Node.js v9+
  • OpenSSL

Configuration

Generate your certificate signing request token in Admin tools → API key, use your certificate in OBF_CERT (environment variable) and run this command :

$ npm run conf

Build Setup

$ docker-compose up

Config file

  • port : Application port
  • urlApi : OpenBadgeFactory API
  • email :
    • subject : Email subject
    • body : Email content, :recipientName var replace by user's email
    • button : Text displayed on the badge recovery button
    • footer : Text displayed in email footer
  • logEntry :
    • client : Name of the badge-issuing application
    • issuer : Issuer name
  • mongo :
    • host : Database host
    • port : Database port
    • db : Database name
  • authority : Authority name used to set licence in a badge
  • cacheTime : Time in hours to regenerate cache from server launch
  • continuousIntegration : Allow to launch the server without the certificates presence

API routes

URL Action Request body
GET / Give the name and version of the application
GET /ping Ping OpenBadgeFactory API
GET /metrics Get total issuances by badge
GET /metrics/count Get count of badges
GET /badges Get user's badges Query String
  • id: trello id
POST /badges/emit Emits badge for user JSON
  • badgeId: ID of the badge to be issued
  • recipient
    • id: recipient id (trello id)
    • email: recipient email
    • name: recipient name
PUT /badges/visibility Change visibility user JSON
  • userId: ID of user
  • visibility: Boolean true/false
GET /share/:type/:uuid/:locale Display issued badge's page HTML
  • type: Type of view (embed/view)
  • uuid: User ID
  • locale: Language en/fr (default: en)