Build or integrate into your solution by using BWS Blockchain Badges API.
A badge is a digital representation of an accomplishment, skill, or authorization that an individual can earn and display. It acts as verifiable proof of the user's achievements and can be shared across various digital platforms, enhancing their professional and personal credibility.
In the context of the Open Badge standard, a badge is represented as a JSON object that includes key metadata such as the badge name, description, criteria for earning it, issuing organization, and recipient information. This standardized format ensures interoperability and enables badges to be verified, trusted, and recognized globally.
new_badge
Use this operation to create a Badge you can later use to certify recognition (award/credentials).
POSThttps://api.bws.ninja/v1/call
Request Body
Name
Type
Description
solution*
string
BWS.Blockchain.Badges
operation*
string
new_badge
parameters*
JSON
new_badge Method Parameters
Parameter
Type
Desciption
issuerId
string
name
string
Badge name (e.g. "Certified Data Analyst").
description
string
A description of the badge and what it represents.
criteria
string
Narrative describing the criteria to earn the badge.
image
base64
The image representing the badge as a base64 encoded string.
Your badge image will be saved on the InterPlanetary File System (IPFS) and served from the BWS IPFS gateway service.
The images you use should be optimized to be consumed over the internet.
You must create your badge image to be less than 1 MB in size for fast access (there is a hard limit of 5MB).
Only the PNG image type is accepted.
new_badge API Call Example
const fs = require('fs');
const axios = require('axios');
/* get the file representing the badge */
const fileData = fs.readFileSync('./files/badge.png');
/* encode file content to base64 */
const encodedData = fileData.toString('base64');
/* build request to use BWS Badges solution */
const request = {
{
"solution": "BWS.Blockchain.Badges",
"operation": "new_badge",
"parameters": {
"name": "Cloud Developer",
"description": "Recognizes professionals who have demonstrated expertise in cloud computing, including development and management of cloud applications and services.",
"criteria": "To earn this badge, complete an accredited course in cloud computing, demonstrate practical experience with a portfolio of cloud projects, and pass an exam on cloud computing concepts, service models, and development practices.",
"image": encodedData
}
}
/* call BWS API using Axios */
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.bws.ninja/v1/call',
headers: {
'X-Api-Key': 'XqaLg...... A5k2V729v', /* use your API key here! */
'Content-Type': 'application/json'
},
data : JSON.stringify(request)
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
new_badge Call Response
When the API call is successfully executed, it returns the badge id, which is also the url you can use to fetch the badge image.