Documentation RAW

Table of Contents


Paid support and whitelabel versions of BloqPress have access to our API.

It provides the following features:


REST API Access

The API can be accessed at the following URL:


http://bloqpress.r1.my/api/

Our API utilizes REST - and while it does not completely conform to the HAL standard, it does implement _links and _embedded properties for linking API resources, which allows it to be fully discoverable and self documenting in its responses. We provide both public data accessible to any client anonymously, as well as private data that is only available after authentication.

Performing a GET request on - http://bloqpress.r1.my/api/cortex/v1 - should produce the following response:

{
    "namespace": "cortex/v1",
    "routes": {
        "/cortex/v1":{
            "namespace": "cortex/v1",
            "methods": [ "GET", "OPTIONS" ],
            "endpoints": [
                {
                    "methods": [ "GET" ],
                    "args": {
                        "namespace": {
                            "required": false,
                            "default": "cortex/v1"
                        },
                        "context": {
                            "required": false,
                            "default": "view"
                        }
                    }
                },
                {
                    "methods": [ "OPTIONS" ],
                    "args": {
                        "/dnkey/": {
                            "required": false,
                            "default": "http://bloqpress.r1.my/api/cortex/v1/dnkey",
                            "description": "http://bloqpress.r1.my/documentation/dnkey",
                            "type": "slug"
                        },
                        "/ethereum/": {
                            "required": false,
                            "default": "http://bloqpress.r1.my/api/cortex/v1/ethereum",
                            "description": "http://bloqpress.r1.my/documentation/ethereum",
                            "type": "slug"
                        },
                        "/wallet/": {
                            "required": false,
                            "default": "http://bloqpress.r1.my/api/cortex/v1/wallet",
                            "description": "http://bloqpress.r1.my/documentation/wallet",
                            "type": "slug"
                        },
                        "/blockauth/": {
                            "required": false,
                            "default": "http://bloqpress.r1.my/api/cortex/v1/blockauth",
                            "description": "http://bloqpress.r1.my/documentation/blockauth",
                            "type": "slug"
                        }
                    }
                }
            ],
            "_links":{
                "self": "http://bloqpress.r1.my/api/cortex/v1"
            }
        },
        "/cortex/v1/dnkey": {
            "namespace": "cortex/v1",
            "methods": [ "GET" ],
            "endpoints": [
                {
                    "methods": [ "GET" ],
                    "args": {
                        "host": {
                            "required": true,
                            "description": "The domain you would like to check the DNS TXT records for DNKey.org broadcasts.",
                            "type": "string"
                        },
                        "index": {
                            "required": false,
                            "description": "The specific type of DNKey.org key requested.",
                            "type": "string"
                        }
                    }
                }
            ],
            "_links":{
                "self": "http://bloqpress.r1.my/api/cortex/v1/dnkey"
            }
        },
        "/cortex/v1/ethereum": {
            "namespace": "cortex/v1",
            "methods": [ "GET" ],
            "endpoints": [
                {
                    "methods": [ "GET" ],
                    "args": {
                        "key": {
                            "required": true,
                            "description": "This endpoint requires a valid BCE API Key that corresponds to the correct referer.",
                            "type": "string"
                        },
                        "method": {
                            "required": true,
                            "description": "The name of the Ethereum function that you would like to invoke.",
                            "type": "string"
                        },
                        "params": {
                            "required": false,
                            "description": "Piped options mostly following Geth Calls",
                            "type": "string"
                        },
                        "chain": {
                            "required": false,
                            "description": "Used to switch from public networks to private consortium networks.",
                            "type": "string"
                        }
                    }
                }
            ],
            "_links": {
                "self": "http://bloqpress.r1.my/api/cortex/v1/ethereum"
            }
        },
        "/cortex/v1/wallet": {
            "namespace": "cortex/v1",
            "methods": [ "GET" ],
            "endpoints": [
                {
                    "methods": [ "GET" ],
                    "args": {
                        "key": {
                            "required": true,
                            "description": "This endpoint requires a valid BCE API Key that corresponds to the correct referer.",
                            "type": "string"
                        },
                        "method": {
                            "required": true,
                            "description": "The name of the Wallet function that you would like to invoke.",
                            "type": "string"
                        },
                        "params": {
                            "required": false,
                            "description": "Piped options as documented",
                            "type": "string"
                        },
                        "chain": {
                            "required": false,
                            "description": "Used to switch from public networks to private consortium networks.",
                            "type": "string"
                        }
                    }
                }
            ],
            "_links": {
                "self": "http://bloqpress.r1.my/api/cortex/v1/wallet"
            }
        },
        "/cortex/v1/blockauth": {
            "namespace": "cortex/v1",
            "methods": [ "GET" ],
            "endpoints": [
                {
                    "methods": [ "GET" ],
                    "args": {
                        "key": {
                            "required": true,
                            "description": "This endpoint requires a valid BCE API Key that corresponds to the correct referer.",
                            "type": "string"
                        },
                        "method": {
                            "required": true,
                            "description": "The name of the BlockAuth function that you would like to invoke.",
                            "type": "string"
                        },
                        "params": {
                            "required": false,
                            "description": "Piped options as documented",
                            "type": "string"
                        },
                        "chain": {
                            "required": false,
                            "description": "Used to switch from public networks to private consortium networks.",
                            "type": "string"
                        }
                    }
                }
            ],
            "_links": {
                "self": "http://bloqpress.r1.my/api/cortex/v1/blockauth"
            }
        }
    },
    "_links": {
        "up": [
            {
                "href": "http://bloqpress.r1.my/api/"
            }
        ]
    }
}

However, the following public DNKey.org endpoint - http://bloqpress.r1.my/api/cortex/v1/dnkey - should produce:

{
    "code": "rest_missing_callback_param",
    "message": "Missing parameter(s): host",
    "data": { 
        "status": 400, 
        "params": [ "host" ]
    }
}

This response informs the exact problem through its status and the required params. Adding the required host parameter - http://bloqpress.r1.my/api/cortex/v1/dnkey?host=bce.bloq.press - should (if that domain is utilizing DNKey.org DNS TXT records) produce:

{
    "code": "success",
    "message": "Successfully fetched data",
    "data": {
        "status": 200,
        "results": {
            "ltc": "LMUN5ZPQCym1sz2XxbunhWsfwJc5nKfANN",
            "btc": [
                "13aaehx6p4QrTHMvQUZy3dTEevXr4Wprap",
                "1M4VYf837vbKc9mJxqGdM2w1xPmZNDXdGa"
            ]
        }
    },
    "_links": {
        "up": [
            {
                "href": "http://bloqpress.r1.my/api/cortex/v1"
            }
        ],
        "help": [
            {
                "name": "toc",
                "href": "http://bloqpress.r1.my/documentation/"
            },
            {
                "name": "self",
                "href": "http://bloqpress.r1.my/documentation/dnkey"
            }
        ],
        "examples": [
            {
                "name": "simple",
                "href": "http://bloqpress.r1.my/api/cortex/v1/dnkey?host=bce.bloq.press"
            },
            {
                "name": "advance",
                "href": "http://bloqpress.r1.my/api/cortex/v1/dnkey?host=bce.bloq.press&index=btc"
            }
        ]
    }
}

In order to make a private API request, such as those needed to make use of the Ethereum functionality, in addition to the required method - you will also need to include your BCE API Key as follows:

http://bloqpress.r1.my/api/cortex/v1/ethereum?method=blockNumber&key=your-api-key

Each API Key is linked to a specific referer domain and can only be used to make requests from that domain.

However, the your-api-key is a specific API Key that enables anyone to view the API responses from this domain.


Table of Contents