LearnCard Developer Docs
  • 🚀Get Started
    • 👋Welcome
    • ⭐Who are you?
      • Learners & Employees
      • Traditional Educator
      • Non-Traditional Educator
      • Assessment Provider
      • Employer
      • App Developer & EdTech
      • DAO & Communities
      • Content Creators
      • Research Institutions
      • NGOs & Governments
      • Plugfest Partner
        • Guide for Interop Issuers
          • 🤽Creating an Interop Issuer
        • Guide for Interop Wallets
    • Protocol Overview
      • The Internet of Education
      • The Learning Economy
      • Learner & Employee Privacy
      • 22nd Century Education
      • The Open Credential Network
      • PVCs
  • 🔰LearnCard SDK
    • What is LearnCard?
      • Why a Universal Wallet?
      • Architectural Patterns
      • Production Deployment Guide
      • Troubleshooting Guide
    • LearnCard Core
      • Quick Start
        • Create New Credentials
          • Creating Verifiable Credentials for LearnCard
          • Achievement Types and Categories
          • Custom Types
          • Understanding Boosts
          • Creating Boost Credentials
        • Sign & Send Credentials
        • Accept & Verify Credentials
        • Share & Present Credentials
      • Construction
        • Managing Seed Phrases
        • initLearnCard
        • DIDKit
        • learnCardFromSeed
        • emptyLearnCard
        • IDX Config
      • Control Planes
        • ID
        • Read
        • Store
        • Index
        • Cache
        • Context
      • Plugins
        • Adding Plugins
        • Official Plugins
          • Dynamic Loader
          • Crypto
          • DIDKit
          • DID Key
          • VC
            • Expiration Sub-Plugin
          • VC Resolution
          • VC-Templates
          • VC-API
          • Ceramic
          • IDX
          • VPQR
          • Ethereum
          • CHAPI
          • LearnCard Network
          • LearnCloud
          • LearnCard
          • Claimable Boosts
        • Writing Plugins
          • The Simplest Plugin
          • The Plugin Type
          • The LearnCard Type
          • Implementing Control Planes
          • Implementing Methods
          • The Implicit LearnCard
          • Depending on Plugins
          • Private Fields
          • Publishing a Plugin to NPM
      • URIs
      • CHAPI
        • ⭐CHAPI Wallet Setup Guide
        • ↔️Translating to CHAPI documentation
        • 🖥️Demo Application
        • 🔰Using LearnCard to Interact with a CHAPI Wallet
        • 📝Cheat Sheets
          • Issuers
          • Wallets
      • LearnCard UX
        • Quick Start
        • Components
          • Verifiable Credentials
            • VC Thumbnail
            • VC Thumbnail, Mini
          • LearnCards
            • LearnCard Front
            • LearnCard Back
        • API
      • LearnCard Bridge
      • API
      • Migration Guide
    • LearnCard Network
      • LearnCard Network API
        • Authentication
        • Auth Grants and API Tokens
        • Profile
        • Credentials
        • Boosts
        • Presentations
        • Storage
        • Signing Authorities
        • Notifications
        • API Docs
        • Launch Your Own Network
      • 🔌Connect Your Application
    • ConsentFlow
      • Setting Up ConsentFlow with an Independent Network
    • GameFlow
      • Sending xAPI Statements
        • xAPI URIs
      • Reading xAPI Statements
        • Advanced xAPI Statement Queries
      • Consentful "Claim Later" Flow
  • 🚀Applications
    • LearnCard
    • SuperSkills!
      • SuperSkills! SDK
        • Digital Wallets
        • Issuing into SuperSkills!
        • 🦸Creating a SuperSkills! Issuer
    • Metaversity
    • Admin Dashboard
  • 🔗Resources
    • Github
    • Community
    • 💅Custom Development
    • Contact Our Team
    • Learning Economy
  • 🤖LearnCard Services
    • LearnCard CLI
    • Discord Bot
    • Metamask Snap
  • 💸LearnBank SDK
    • Why LearnBank?
  • 📊LearnGraph SDK
    • Why LearnGraph?
Powered by GitBook
On this page

Was this helpful?

  1. LearnCard SDK
  2. LearnCard Network
  3. LearnCard Network API

Boosts

Boosts Management

PreviousCredentialsNextPresentations

Last updated 3 months ago

Was this helpful?

1. Create a Boost

To create a boost, use the createBoost method. This method accepts a credential object (which can be an UnsignedVC or VC) and an optional metadata object.

const credential = your_credential;
const metadata = {
  name: 'Your Boost Name',
  description: 'Your Boost Description',
};

learnCard.invoke.createBoost(credential, metadata);

2. Get a Boost

To get a boost, use the getBoost method. This method accepts a uri parameter.

const uri = 'your_boost_uri';

learnCard.invoke.getBoost(uri);

3. Get Boosts

To retrieve all boosts, use the getBoosts method.

learnCard.invoke.getBoosts();

4. Get Boost Recipients

To get boost recipients, use the getBoostRecipients method. This method accepts a uri parameter and optional limit and skip parameters.

const uri = 'your_boost_uri';
const limit = 10;
const skip = 0;

learnCard.invoke.getBoostRecipients(uri, limit, skip);

5. Update a Boost

To update a boost, use the updateBoost method. This method accepts a uri parameter, an updates object, and a credential object (which can be an UnsignedVC or VC).

const uri = 'your_boost_uri';
const updates = {
  name: 'Updated Boost Name',
  description: 'Updated Boost Description',
};
const credential = updated_credential;

learnCard.invoke.updateBoost(uri, updates, credential);

6. Delete a Boost

To delete a boost, use the deleteBoost method. This method accepts a uri parameter.

const uri = 'your_boost_uri';

learnCard.invoke.deleteBoost(uri);

7. Send a Boost

To send a boost to another profile, use the sendBoost method. This method accepts a profileId, a boostUri parameter, and an optional encrypt parameteropconst profileId = 'janesmith';

const boostUri = 'your_boost_uri';
const encrypt = true;

learnCard.invoke.sendBoost(profileId, boostUri, encrypt);

These are the API calls related to boosts management in the LearnCard Network API. Use these methods to create, update, retrieve, and delete boosts, as well as send boosts to other profiles.

Claim a Boost

const boostUri = 'https://example.com/boost-uri';
const challenge = 'example-challenge';

await networkLearnCard.invoke.claimBoostWithLink(boostUri, challenge);

These examples demonstrate some of the ways you can interact with the LearnCard Network API using the @learncard/network-plugin.

🔰

Get boost

get

This endpoint gets metadata about a boost

Authorizations
Query parameters
uristringRequired
Responses
200
Successful response
application/json
default
Error response
application/json
get
GET /api/boost?uri=text HTTP/1.1
Host: ..
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "name": "text",
  "type": "text",
  "category": "text",
  "status": "DRAFT",
  "autoConnectRecipients": true,
  "meta": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "claimPermissions": {
    "role": "text",
    "canEdit": true,
    "canIssue": true,
    "canRevoke": true,
    "canManagePermissions": true,
    "canIssueChildren": "text",
    "canCreateChildren": "text",
    "canEditChildren": "text",
    "canRevokeChildren": "text",
    "canManageChildrenPermissions": "text",
    "canManageChildrenProfiles": false,
    "canViewAnalytics": true
  },
  "uri": "text",
  "boost": {
    "@context": [
      "text"
    ],
    "id": "text",
    "type": [
      "text"
    ],
    "issuer": "text",
    "credentialSubject": {
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "refreshService": {
      "id": "text",
      "type": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "credentialSchema": {
      "id": "text",
      "type": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "issuanceDate": "text",
    "expirationDate": "text",
    "credentialStatus": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "name": "text",
    "description": "text",
    "validFrom": "text",
    "validUntil": "text",
    "status": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "termsOfUse": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "evidence": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}
  • 1. Create a Boost
  • POSTCreates a boost
  • 2. Get a Boost
  • 3. Get Boosts
  • GETGet boost
  • 4. Get Boost Recipients
  • 5. Update a Boost
  • 6. Delete a Boost
  • 7. Send a Boost
  • POSTSend a Boost
  • POSTSend a Credential
  • Claim a Boost

Creates a boost

post

This route creates a boost

Authorizations
Body
namestringOptional
typestringOptional
categorystringOptional
statusstring · enumOptionalPossible values:
autoConnectRecipientsbooleanOptional
credentialany ofRequired
or
Responses
200
Successful response
application/json
Responsestring
default
Error response
application/json
post
POST /api/boost/create HTTP/1.1
Host: ..
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1427

{
  "name": "text",
  "type": "text",
  "category": "text",
  "status": "DRAFT",
  "autoConnectRecipients": true,
  "meta": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "credential": {
    "@context": [
      "text"
    ],
    "id": "text",
    "type": [
      "text"
    ],
    "issuer": "text",
    "credentialSubject": {
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "refreshService": {
      "id": "text",
      "type": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "credentialSchema": {
      "id": "text",
      "type": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "issuanceDate": "text",
    "expirationDate": "text",
    "credentialStatus": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "name": "text",
    "description": "text",
    "validFrom": "text",
    "validUntil": "text",
    "status": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "termsOfUse": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "evidence": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "proof": {
      "type": "text",
      "created": "text",
      "challenge": "text",
      "domain": "text",
      "nonce": "text",
      "proofPurpose": "text",
      "verificationMethod": "text",
      "jws": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "claimPermissions": {
    "role": "text",
    "canEdit": true,
    "canIssue": true,
    "canRevoke": true,
    "canManagePermissions": true,
    "canIssueChildren": "text",
    "canCreateChildren": "text",
    "canEditChildren": "text",
    "canRevokeChildren": "text",
    "canManageChildrenPermissions": "text",
    "canManageChildrenProfiles": false,
    "canViewAnalytics": true
  }
}
text

Send a Boost

post

This endpoint sends a boost to a profile

Authorizations
Path parameters
profileIdstringRequired
Body
uristringRequired
credentialany ofRequired
or
Responses
200
Successful response
application/json
Responsestring
default
Error response
application/json
post
POST /api/boost/send/{profileId} HTTP/1.1
Host: ..
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1027

{
  "uri": "text",
  "credential": {
    "@context": [
      "text"
    ],
    "id": "text",
    "type": [
      "text"
    ],
    "issuer": "text",
    "credentialSubject": {
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "refreshService": {
      "id": "text",
      "type": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "credentialSchema": {
      "id": "text",
      "type": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "issuanceDate": "text",
    "expirationDate": "text",
    "credentialStatus": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "name": "text",
    "description": "text",
    "validFrom": "text",
    "validUntil": "text",
    "status": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "termsOfUse": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "evidence": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "proof": {
      "type": "text",
      "created": "text",
      "challenge": "text",
      "domain": "text",
      "nonce": "text",
      "proofPurpose": "text",
      "verificationMethod": "text",
      "jws": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "options": {
    "skipNotification": false
  }
}
text

Send a Credential

post

This endpoint sends a credential to a user based on their profileId

Authorizations
Path parameters
profileIdstringRequired
Body
credentialany ofRequired
or
or
Responses
200
Successful response
application/json
Responsestring
default
Error response
application/json
post
POST /api/credential/send/{profileId} HTTP/1.1
Host: ..
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 786

{
  "credential": {
    "@context": [
      "text"
    ],
    "id": "text",
    "type": [
      "text"
    ],
    "issuer": "text",
    "credentialSubject": {
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "refreshService": {
      "id": "text",
      "type": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "credentialSchema": {
      "id": "text",
      "type": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "issuanceDate": "text",
    "expirationDate": "text",
    "credentialStatus": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "name": "text",
    "description": "text",
    "validFrom": "text",
    "validUntil": "text",
    "status": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "termsOfUse": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "evidence": {
      "type": "text",
      "id": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}
text