BCdiploma Knowledge BaseBCdiploma Knowledge Base
User guide
Technical guide
API
Terms and Data
  • English
  • Français
User guide
Technical guide
API
Terms and Data
  • English
  • Français
  • API

    • How to use BCdiploma API
    • Automate issuing process
    • Deletions and revocations
    • Update
    • Certificate Template Management
    • Learning Pathway Management
    • Download
    • Data Export
    • Miscellaneous APIs
    • Management of errors

Download

General Information

The download API endpoints are specific; here they are:

  • Staging: https://toolbox-staging.bcdiploma.com
  • Production (data is located in the EU zone - default) : https://toolbox.bcdiploma.com
  • Production (data is located in the US zone - on demand) : https://toolbox-cus.bcdiploma.com

These endpoints are referred to as [TOOLBOX-URL] in the documentation below.

Bulk PDF Download

Functionality

The bulk download API allows users to export a set of certificates in PDF format in a single operation. This API corresponds to the "Export to PDF" feature available in the back office after selecting multiple certificates. To recap, the "Export to PDF" works as follows:

  1. The user selects the archive format: either "one PDF per certificate" or "multiple certificates per PDF" (a single PDF file containing all selected certificates). Naming and grouping options are also available, but only in the BackOffice.
  2. After clicking "Export to PDF," the user receives an initial email informing them that their PDF export is in progress. This email includes a password, which will be required to open the archive containing the exported certificates, received in a second email. Since the export can take some time, the process is asynchronous.
  3. From a few minutes to several hours after the initial email (depending on the number of certificates being exported), the user receives a second email with the archive. The user can then open it using the previously received password with a compatible manager, such as 7zip. The built-in Windows tool is not compatible due to security reasons.

Using the Bulk PDF Download API

The bulk PDF download web service is accessible via a POST call to the endpoint [TOOLBOX-URL]/pdf.

An authentication token and an HTTP header Content-Type: application/json are required.

The request body is a JSON-formatted string with several required fields:

  • email: the email address to which the export will be sent.
  • exportMultiPdf: the archive format, set to true for "one PDF per certificate," or false for "multiple certificates per PDF."
  • data: an array of certificates to export, identified by their key, specifying the desired lang for the PDF (particularly useful for multilingual certificates), and an output filename.

Note that the naming and grouping options available in the BackOffice are not available via the API.

In the following examples, the export will be sent as a ZIP archive to john.doe@bcdiploma.com.

Example 1

Export of 2 certificates in English, one PDF file per certificate, with files prefixed by export. A unique name will be generated for each file.

{
  "email": "john.doe@bcdiploma.com",
  "exportMultiPdf": true,
  "data": [
    {
      "key": "B49B8E13BEC1DC9879F4A3A1A264A91E7BD7D7EE8572D55EA6F9A1E83CA046F2bFpTaFFpV29YM1dzVDUvYTBwTnRSM2pqVEdGWGlBdmZUUFJwdlJlSXJQVkxpSUZn",
      "lang": "en",
      "filename": "export"
    },
    {
      "key": "8F3382902DF9096ECA90CAB200471FBEFB90097134C7D44B746E17427223D5CFd0FscDZJVm1vc1hhU3JKckJ2aFBPbzNYdXBiWFd6ZXpxcmRmRFJ4eFpjNjc2S0g3",
      "lang": "en",
      "filename": "export"
    }
  ]
}

Example 2

Export of 2 certificates in English in a single file named export.pdf.

{
  "email": "john.doe@bcdiploma.com",
  "exportMultiPdf": false,
  "data": [
    {
      "key": "B49B8E13BEC1DC9879F4A3A1A264A91E7BD7D7EE8572D55EA6F9A1E83CA046F2bFpTaFFpV29YM1dzVDUvYTBwTnRSM2pqVEdGWGlBdmZUUFJwdlJlSXJQVkxpSUZn",
      "lang": "en",
      "filename": "export"
    },
    {
      "key": "8F3382902DF9096ECA90CAB200471FBEFB90097134C7D44B746E17427223D5CFd0FscDZJVm1vc1hhU3JKckJ2aFBPbzNYdXBiWFd6ZXpxcmRmRFJ4eFpjNjc2S0g3",
      "lang": "en",
      "filename": "export"
    }
  ]
}

Example 3

Export of 2 certificates in English, one PDF per certificate, with the first file stored in directory1 and the second in directory2.

{
  "email": "john.doe@bcdiploma.com",
  "exportMultiPdf": true,
  "data": [
    {
      "key": "B49B8E13BEC1DC9879F4A3A1A264A91E7BD7D7EE8572D55EA6F9A1E83CA046F2bFpTaFFpV29YM1dzVDUvYTBwTnRSM2pqVEdGWGlBdmZUUFJwdlJlSXJQVkxpSUZn",
      "lang": "en",
      "filename": "directory1\\export"
    },
    {
      "key": "8F3382902DF9096ECA90CAB200471FBEFB90097134C7D44B746E17427223D5CFd0FscDZJVm1vc1hhU3JKckJ2aFBPbzNYdXBiWFd6ZXpxcmRmRFJ4eFpjNjc2S0g3",
      "lang": "en",
      "filename": "directory2\\export"
    }
  ]
}

A 200 status will be returned if the process is successful.

Single PDF Download

Active, non-expired certificates can be downloaded as PDFs via API. This single-download API does not require authentication.

URL: [TOOLBOX-URL]/pdf/<key>where <key> is the unique identifier of the certificate.

Optional parameters:

ParameterDescriptionDefault value
landscapefalse = portrait, true = landscapetrue
langISO code of the target languageDefault certificate language
filenameOutput file name (w/o extension)certificate_YYYYMMDDHHMMSS.pdf

Example:

https://toolbox.bcdiploma.com/pdf/1001016C25F8D530F7515E129166BCD51F9AA5C58E390287A0DC3CC02FBC0EFDREVvdlV5cm8xR1dTaE13TE9nMHJ5ZVR2TFRtMmxTNUJmNHVPRTFJYmlwb2J0NFdj?lang=ar&filename=mycertificate

Downloading the proof of deposit of a file associated with a certificate

If your certificate template allows it, you may have associated a file (ZIP archive, PDF, etc.) to your certificates when publishing. You can retrieve the proof of deposit of this associated file via the following API. This single-download API does not require authentication.

URL: [TOOLBOX-URL]/doc/<certId> where <certId> is the unique identifier of the certificate.

Optional parameters :

ParametersDescriptionDefault value
fileFieldIdname of the field containing the filefile_A
proofOnlyif missing and if the associated file is a PDF, this one will be concatenated to the proof fileN/A
withCertLinkif present, add a QRcode and a link to the certificate in the proof fileN/A
filenameOutput file name (w/o extension)proofs_YYYYMMDDHHMMSS.pdf
qrcodeLastPageIf present, add the QR code only up to the page number indicated (e.g.: 1)All pages

Example: retrieve the proof of deposit of a file associated with a certificate, on the staging environment, without QR code or link to the certificate:

https://toolbox.bcdiploma.com/doc/01A16D5BA729C36B14F193E3FAF3957016AB469047978A70FA9B430546BDCAFDMWNVdEVHaW03Q2tEZUIyRi93RmJnRXlSZzdmK3Z1aWptSkl0dEJwRUdjdFZodGxr?fileFieldId=file_A&proofOnly&filename=proofs

Generating a QR Code for a certificate

You can generate by yourself a QRcode identical to the one embedded in the PDF certificates. For this, we recommend the use of this Javascript library.

To obtain a QRcode iso with the one generated in the PDF of the certificates, make sure to pass the same values to the parameters indicated in the example code below. This example returns a QR code in svg format.

// install https://github.com/soldair/node-qrcode npm package
// npm install --save qrcode

var QRCode = require("qrcode");
// put here the url of the certificate for which you want to generate a QR code
var data =
  "https://certificate.bcdiploma.com/check/A85CFBC956B6C38F646162D64FC8970F827A57359A59E68C1076644982A0E34CbitkclhPMFhSS2N2dWl2aFZEczJDS041S05UUGR2Y290UFVPU2l2RmtISEE0ZW1u";

// The QR code is returned here in the svg format
QRCode.toString(data, {
  type: "svg",
  errorCorrectionLevel: "M",
  bgColor: "#ffffff",
  fgColor: "#000000",
})
  .then(function (svgQRCode) {
    console.log(svgQRCode);
  })
  .catch(function (err) {
    console.error(err);
  });
Prev
Learning Pathway Management
Next
Data Export