Skip to main content
Version: v2.1.2

API Reference

API Request Domain

http://<ip_address_OR_Domain>:40020/

Call Method

Introduce the calling methods of OpenAPI, including: prerequisites, request structure, public parameters, authentication mechanism, and response results.

Prerequisites

When requesting an API, you need to use the Basic Auth authentication which contains a token_id and token_secret in base64 format,

Obtain the Token ID and Secret

  • Login into the Bitstreams User Interface
  • Navigate to the "Settings" Page
  • Select the "Access Token" Tab
  • Select the "Environment" and click "Generate New Token"
  • Provide the a Name for the Token and click "Generate Token"
  • Record the Token_ID and Token_Secret

Public Parameters

NameTypeMandatoryValueExplanation
Content-TypestringYesapplication/jsonJson head

Common Return Parameter

NameTypeReturnedExplanation
err_codeintYes0 means the request is normal, see the error message for other details.
err_messagestringYesError message

Authentication Method

Authentication Method: Basic Auth

Create base64

The base64 can be created using an linux OS and the base64 command.

NOTE: There is a : (colon) between the Token ID and Token Secret

echo -n <token_id>:<token_secret> | base64

API Syntax Example

curl --location 'http://<Domain_Address>:<Domain_Port>/api/v2/xxx' \
--header 'Authorization: Basic <base64_string>' \
--data ''

Using Postman

Postman can be used to send and receive API request and responses. Postman automatically creates the base64 Authorization. In the Username field uses the Token ID and the Password field uses Token_Secret