favorX API (1.2.2)

Download OpenAPI specification:Download

A list of the currently provided Interfaces to interact with the boson, implementing file operations and sending messages

Auth

Authenticate - This endpoint is experimental

Authorizations:
None
Request Body schema: application/json
Role
string
Expiry
integer

Responses

Request samples

Content type
application/json
{
  • "Role": "string",
  • "Expiry": 0
}

Response samples

Content type
application/json
{
  • "Key": "string"
}

Refresh the auth token - This endpoint is experimental

Authorizations:
None
Request Body schema: application/json
Role
string
Expiry
integer

Responses

Request samples

Content type
application/json
{
  • "Role": "string",
  • "Expiry": 0
}

Response samples

Content type
application/json
{
  • "Key": "string"
}

Bytes

Upload data

Authorizations:
None
header Parameters
pin
boolean

Represents the pinning state of the chunk

encrypt
boolean

Represents the encrypting state of the file

Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "reference": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Get referenced data

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Address reference to content

Responses

Response samples

Content type
application/problem+json
"string"

Chunk

Upload Chunk

Authorizations:
None
header Parameters
pin
boolean

Represents the pinning state of the chunk

Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "reference": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Get chunk

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of chunk

query Parameters
targets
string

Global pinning targets prefix

Responses

Response samples

Content type
application/problem+json
"string"

File

Upload file or a collection of files

In order to upload a collection, user can send a multipart request with all the files populated in the form data with appropriate headers.

User can also upload a tar file along with the collection header. This will upload the tar file after extracting the entire directory structure.

If the collection header is absent, all requests (including tar files) are considered as single file uploads.

A multipart request is treated as a collection regardless of whether the collection header is present. This means in order to serve single files uploaded as a multipart request, the index-document header should be used with the name of the file.

Authorizations:
None
header Parameters
pin
boolean

Represents the pinning state of the chunk

encrypt
boolean

Represents the encrypting state of the file

content-type
string

The specified content-type is preserved for download of the asset

collection
boolean

Upload file/files as a collection

index-document
string
Example: index.html

Default file to be referenced on path, if exists under that path

error-document
string
Example: error.html

Configure custom error document to be returned when a specified path can not be found in collection

reference-link
string
Example: xxx://xxx

Configure third-party storage reference links

Request Body schema:
file
Array of strings <binary>

Responses

Response samples

Content type
application/json
{
  • "reference": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Page the file list

Authorizations:
None
query Parameters
filter
string
Example: filter=[ { "key": "FieldName","term": "eq","value": "false" } ]
page
required
string
Example: page={ "pageNum": 1, "pageSize": 10 }
sort
string
Example: sort={ "key": "FieldName", "order": "desc" }

Responses

Response samples

Content type
application/json
{
  • "total": 0,
  • "list": [
    ]
}

Get file or index document from a collection of files

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

query Parameters
targets
string

Global pinning targets prefix

Responses

Response samples

Content type
application/problem+json
"string"

Delete file or a collection of files

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

Responses

Response samples

Content type
application/problem+json
"string"

If path to a directory, show items under path. Show the content type.

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

path
string

An exist path in the collection. If the path point to a directory, path must end with slash.

Responses

Response samples

Content type
application/json
{
  • "type": "string",
  • "hash": {
    },
  • "name": "string",
  • "size": 0,
  • "ext": "string",
  • "mime": "string",
  • "sub": { }
}

FileRegister registers the information to the chain after the file upload is successful.

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

Responses

Response samples

Content type
application/json
{
  • "hash": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Remove registration information from the chain.

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

Responses

Response samples

Content type
application/json
{
  • "hash": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Collection

Upload file or a collection of files

In order to upload a collection, user can send a multipart request with all the files populated in the form data with appropriate headers.

User can also upload a tar file along with the collection header. This will upload the tar file after extracting the entire directory structure.

If the collection header is absent, all requests (including tar files) are considered as single file uploads.

A multipart request is treated as a collection regardless of whether the collection header is present. This means in order to serve single files uploaded as a multipart request, the index-document header should be used with the name of the file.

Authorizations:
None
header Parameters
pin
boolean

Represents the pinning state of the chunk

encrypt
boolean

Represents the encrypting state of the file

content-type
string

The specified content-type is preserved for download of the asset

collection
boolean

Upload file/files as a collection

index-document
string
Example: index.html

Default file to be referenced on path, if exists under that path

error-document
string
Example: error.html

Configure custom error document to be returned when a specified path can not be found in collection

reference-link
string
Example: xxx://xxx

Configure third-party storage reference links

Request Body schema:
file
Array of strings <binary>

Responses

Response samples

Content type
application/json
{
  • "reference": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Get file or index document from a collection of files

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

query Parameters
targets
string

Global pinning targets prefix

Responses

Response samples

Content type
application/problem+json
"string"

Delete file or a collection of files

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

Responses

Response samples

Content type
application/problem+json
"string"

Get referenced file from a collection of files

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

path
required
string

Path to the file in the collection.

query Parameters
targets
string

Global pinning targets prefix

Responses

Response samples

Content type
application/problem+json
"string"

If path to a directory, show items under path. Show the content type.

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

path
string

An exist path in the collection. If the path point to a directory, path must end with slash.

Responses

Response samples

Content type
application/json
{
  • "type": "string",
  • "hash": {
    },
  • "name": "string",
  • "size": 0,
  • "ext": "string",
  • "mime": "string",
  • "sub": { }
}

FileRegister registers the information to the chain after the file upload is successful.

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

Responses

Response samples

Content type
application/json
{
  • "hash": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Remove registration information from the chain.

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

Responses

Response samples

Content type
application/json
{
  • "hash": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Pinning

Pin the root hash with the given reference

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) (BosonOnlyReference)

Boson reference of the root hash

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Unpin the root hash with the given reference

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Get pinning status of the root hash with the given reference

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) (BosonOnlyReference)

Boson reference of the root hash

Responses

Response samples

Content type
application/json
Example
"36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"

Get the list of pinned root hash references

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "addresses": [
    ]
}

Traffic

Get the remaining flow and the total flow usage

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "balance": 0,
  • "availableBalance": 0,
  • "totalSendTraffic": 0,
  • "receivedTraffic": 0
}

Get the chain account address

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "reference": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Acquire traffic interaction information of each node

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "peer": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f",
  • "outstandingTraffic": 0,
  • "sendTraffic": 0,
  • "receivedTraffic": 0,
  • "total": 0,
  • "unCashed": 0
}

cheque exchange

Authorizations:
None
path Parameters
required
BosonAddress (string) or BosonEncryptedReference (string) or DomainName (string) (BosonReference)

Boson address of content

Responses

Response samples

Content type
application/json
{
  • "hash": "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
}

Group

Join to group with the given gid

Authorizations:
None
path Parameters
gid
required
string (BosonAddress) ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

group address or name

Request Body schema: application/json
name
string

group name

type
number

0 join group, 1 observe group

keep-connected-peers
number

the param must

keep-ping-peers
number

the param must

nodes
Array of any

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "type": 0,
  • "keep-connected-peers": 0,
  • "keep-ping-peers": 0,
  • "nodes": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Leave the group with the given gid

Authorizations:
None
path Parameters
gid
required
string (BosonAddress) ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

group address

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

observe to group with the given gid

Authorizations:
None
path Parameters
gid
required
string (BosonAddress) ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

group address or name

Request Body schema: application/json
name
string

group name

type
number

0 join group, 1 observe group

keep-connected-peers
number

the param must

keep-ping-peers
number

the param must

nodes
Array of any

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "type": 0,
  • "keep-connected-peers": 0,
  • "keep-ping-peers": 0,
  • "nodes": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

cancel observe the group with the given gid

Authorizations:
None
path Parameters
gid
required
string (BosonAddress) ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

group address

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

send a message to group with the given gid

Authorizations:
None
path Parameters
gid
required
string (BosonAddress) ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

group address

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Send a message to the node in the group with the given gid.

Authorizations:
None
path Parameters
gid
required
string (BosonAddress) ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

group address

target
required
string (BosonAddress) ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

target address

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "data": "string"
}

Send a message to the node in the group with the given gid. no result

Authorizations:
None
path Parameters
gid
required
string (BosonAddress) ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

group address

target
required
string (BosonAddress) ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

target address

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": 0
}

Get the peers in the group with the given gid

Authorizations:
None
path Parameters
gid
required
string (BosonAddress) ^[A-Fa-f0-9]{64}$
Example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f

group address

Responses

Response samples

Content type
application/json
{
  • "connected": [
    ],
  • "keep": [
    ]
}

Status

Get debugapi/rpc port of node

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "debugApiPort": "string",
  • "rpcWsPort": "string"
}