Alexandrias Hosted APIs

From OIP Wiki
Jump to: navigation, search
Get Summary Info Get All Get One Search New Edit Reassign Ownership Deactivate
Index /v2/info
Publishers /v2/publisher/get/all /v2/search /v1/sign

/v1/send

In Development
Artifacts /v2/media/get/all /v2/artifact/get/ /v2/search /v1/sign

/v1/send

/v2/sign

/v2/send

/v2/sign

/v2/send

/v2/sign

/v2/send

Retailers /v2/retailers/get/all In Development /v2/sign

/v2/send

In Development In Development In Development
Promoters /v2/promoters/get/all In Development /v2/sign

/v2/send

In Development In Development In Development
Autominers /v2/autominer/get/all In Development /v2/sign

/v2/send

In Development In Development In Development
Autominer Pools /v2/autominerpool/get/all In Development /v2/sign

/v2/send

In Development In Development In Development
Alexandria's

Autominer Pool

/pool/api/stats

/pool/api/pool_stats

/pool/api/live_stats

Alexandria's

TradeBot Node

/tradebot/flobalance /tradebot/depositaddress?floaddress=
PoW Network /v2/getMiningInfo
Token Market /flo-market-data/v1/getAll
Transaction

Comments

/florincoin/searchTxComment


*Important Note: To use Open Index Protocol APIs in a fully decentralized/trustless way, you'll need to install and run OIP Daemon. Once you've done so, you'll be able to use the API endpoints below listed as Decentralized

Index

Get Index Summary Info

Retrieves the current count of published artifacts and how many of them are commercial artifacts. Calculates the average artCost value for all commercial artifacts.

HTTP Request

Parameters

n/a

Result

{
   "avgArtCost": floating-point number,
   "paidArtCount": integer,
   "artCount": integer
}

Publishers

Get All Publishers

Retrieves the current list of all registered publishers.

HTTP Request

Parameters

n/a

Result

{
    "publisher-data": {
        "alexandria-publisher":{
            "name": "string",
            "address": "string",
            "timestamp": 10-digit integer,
            "emailmd5": "string",
            "bitmessage": "string",
            "extraInfo": null
        },
        "signature": "string"
    },
    "txid": "string",
    "block": integer
}

Search Publishers

Retrieves the list of all publishers which match the search criteria.

HTTP Request

Parameters

Parameter Description Example(s)
protocol which table "publisher"
search-on field name "name", ("address" "emailmd5" "bitmessage" "txid")
search-for search string "imogen heap"

Optional Parameters

Parameter Description Example(s)
search-like boolean true (false)

Result

{
    "publisher-data": {
        "alexandria-publisher":{
            "name": "string",
            "address": "string",
            "timestamp": 10-digit integer,
            "emailmd5": "string",
            "bitmessage": "string",
            "extraInfo": null
        },
        "signature": "string"
    },
    "txid": "string",
    "block": integer
}

Register New Publisher

All functions which make changes to the contents of the Index will generally require two API calls, one to generate a signature, and another to send the data to the blockchain.

Generate a Publisher Registration Signature

Based on a given FLO public key, the users wallet signs a message with the corresponding private key.

HTTP Request

  • Type: POST
  • Endpoint URL: host/alexandria/v1/sign
  • Decentralized: http://localhost:41289/alexandria/v1/sign[1]
  • Web Hosted: n/a

Parameters

Parameter Description Example(s)
address publisher's florincoin address "FNa3C96zuEtA5Zra54wkLpMZ6mRvTCo5uG"
text publisherName-publisherAddress-timestamp "Alexandria Demo Publisher-FNa3C96zuEtA5Zra54wkLpMZ6mRvTCo5uG-1462071836"

Result

{
    "status": "success",
    "response": [
         signature
    ]
}

Send Publisher Registration To Index

Description

HTTP Request

  • Type: POST
  • Endpoint URL: host/alexandria/v1/send
  • Decentralized: http://localhost:41289/alexandria/v1/send[1]
  • Web Hosted: n/a

Parameters

Parameter Description Example(s)
name publisher name (alias only, not unique) "Alexandria Demo Publisher"
address publisher address "FNa3C96zuEtA5Zra54wkLpMZ6mRvTCo5uG"
timestamp 10 digit unixtime "1462071836"
bitmessage bitmessage address ""
emailmd5 m5d hash of email address (for gravatar) ""
signature signature "IBcmJAekHAmVUYjINqaMzAoDDUycgjmbk+km02JGIMjrMrYI3Q2dIUooz9b0VNOgUoAWAtpKL5nx/Kw7SSK57j8="

JSON Formatting with Example Data

{
    "alexandria-publisher": {
          "name":"Alexandria Demo Publisher",
          "address":"FNa3C96zuEtA5Zra54wkLpMZ6mRvTCo5uG",
          "timestamp": 1462071836,
          "bitmessage":"",
          "emailmd5":""
    },
    "signature":"IBcmJAekHAmVUYjINqaMzAoDDUycgjmbk+km02JGIMjrMrYI3Q2dIUooz9b0VNOgUoAWAtpKL5nx/Kw7SSK57j8="
}

Result

{
    "status": "success",
    "response": [
         transactionID
    ]
}

Artifacts

Get All Artifacts

Retrieves the current list of all registered publishers.

HTTP Request

Parameters

n/a

Result

{
    "oip-041":{
        "artifact":{
            "publisher": "string",
            "timestamp": 10 digit integer,
            "type": "string",
            "info":{
                "title": "string",
                "description": "string",
                "year": 4 digit integer,
                "extraInfo":{
                    "artist": "string",
                    "company": "string",
                    "tags":[
                        "string",
                        "string"
                        ]
                    }
                },
            "payment":{
                "fiat": "string",
                "scale": integer,
                "sugTip":[
                    integer,
                    integer,
                    integer
                    ],
                "addresses": {
                    "three letter string":"string",
                    "three letter string":"string"
                },
                "tokens": {
                    "STRING": integer,
                    "STRING": integer
                }
                },
            "storage":{
                "network": "string",
                "location": "string,
                "files":[
                    {
                        "disBuy": boolean,
                        "disPlay": boolean,
                        "dName": "string",
                        "duration": integer,
                        "fName": "string",
                        "fSize": integer,
                        "sugPlay": "integer",
                        "minPlay": "integer",
                        "sugBuy": "integer",
                        "minBuy": "integer",
                        "disPer": "integer",
                        "promo": "integer",
                        "retail": "integer",
                        "ptpFT": integer,
                        "ptpDT": integer,
                        "ptpDA": integer,
                        "type": "string",
                        "tokenlyID": "string"
                    }
                },
            "signature": "string"
        }
}

Get One Artifact

Retrieves a single artifact by ID.

HTTP Request

  • Type: GET
  • Endpoint URL: host/alexandria/v2/artifact/get?id=XX
  • Decentralized: http://localhost:41289/alexandria/v2/artifact/get?id=XX[1]
  • Web Hosted: https://api.alexandria.io/alexandria/v2/artifact/get?id=XX

Query Parameters

id = ArtifactID

Result

{
    "oip-041":{
        "artifact":{
            "publisher": "string",
            "timestamp": 10 digit integer,
            "type": "string",
            "info":{
                "title": "string",
                "description": "string",
                "year": 4 digit integer,
                "extraInfo":{
                    "artist": "string",
                    "company": "string",
                    "tags":[
                        "string",
                        "string"
                        ]
                    }
                },
            "payment":{
                "fiat": "string",
                "scale": integer,
                "sugTip":[
                    integer,
                    integer,
                    integer
                    ],
                "addresses": {
                    "three letter string":"string",
                    "three letter string":"string"
                },
                "tokens": {
                    "STRING": integer,
                    "STRING": integer
                }
                },
            "storage":{
                "network": "string",
                "location": "string,
                "files":[
                    {
                        "disBuy": boolean,
                        "disPlay": boolean,
                        "dName": "string",
                        "duration": integer,
                        "fName": "string",
                        "fSize": integer,
                        "sugPlay": "integer",
                        "minPlay": "integer",
                        "sugBuy": "integer",
                        "minBuy": "integer",
                        "disPer": "integer",
                        "promo": "integer",
                        "retail": "integer",
                        "ptpFT": integer,
                        "ptpDT": integer,
                        "ptpDA": integer,
                        "type": "string",
                        "tokenlyID": "string"
                    }
                },
            "signature": "string"
        }
}

Search Artifacts

Retrieves the list of all artifacts which match the search criteria.

HTTP Request

Parameters

Parameter Description Example(s)
protocol which table "media"
search-on field name "*"
search-for search string "alexandria demo publisher"

Optional Parameters

Parameter Description Example(s)
search-like boolean true (false)

Result

{
    "oip-041":{
        "artifact":{
            "publisher": "string",
            "timestamp": 10 digit integer,
            "type": "string",
            "info":{
                "title": "string",
                "description": "string",
                "year": 4 digit integer,
                "extraInfo":{
                    "artist": "string",
                    "company": "string",
                    "tags":[
                        "string",
                        "string"
                        ]
                    }
                },
            "payment":{
                "fiat": "string",
                "scale": integer,
                "sugTip":[
                    integer,
                    integer,
                    integer
                    ],
                "addresses": {
                    "three letter string":"string",
                    "three letter string":"string"
                },
                "tokens": {
                    "STRING": integer,
                    "STRING": integer
                }
                },
            "storage":{
                "network": "string",
                "location": "string,
                "files":[
                    {
                        "disBuy": boolean,
                        "disPlay": boolean,
                        "dName": "string",
                        "duration": integer,
                        "fName": "string",
                        "fSize": integer,
                        "sugPlay": "integer",
                        "minPlay": "integer",
                        "sugBuy": "integer",
                        "minBuy": "integer",
                        "disPer": "integer",
                        "promo": "integer",
                        "retail": "integer",
                        "ptpFT": integer,
                        "ptpDT": integer,
                        "ptpDA": integer,
                        "type": "string",
                        "tokenlyID": "string"
                    }
                },
            "signature": "string"
        }
}

Retailers

Retrieves the list of all currently registered Retailers.

HTTP Request

Parameters

n/a

Result

[
    {
        "oip-041": {
            "retailer": {
                "FLOaddress": "string",
                "BTCaddress": "string",
                "web-url": "string",
                "version": integer,
                "optional-fields": {
                    "name": "string",
                    "minimum-share": integer
                }
            },
            "signature": "string"
        },
        "txid": "string",
        "block": integer,
        "block-time": 10 digit integer
    },
    {...} 
]

deprecated Register Retailer schema

Promoters

Retrieves the list of all currently registered Promoters.

HTTP Request

Parameters

n/a

Result

[
    "oip-041": {  
        "promoter": {
                "FLOaddress": "string",
                "BTCaddress": "string",
                "version": integer,
                "social": {  
                    "facebook":"string",
                    "twitter":"string",
                    "instagram":"string"
                }
            },
            "signature": "string"
        },
        "txid": "string",
        "block": integer,
        "block-time": 10-digit integer
    },
    {...}
 ]

deprecated Register Promoter schema

Autominer Pool

Get All Autominer-Pools

Retrieves the current list of all registered Autominer-Pools.

HTTP Request

Parameters

n/a

Result

{  
	"autominer-pool-data":{  
		"alexandria-autominer-pool":{  
			"FLOaddress":"string",
			"WebURL":"string",
			"TargetMargin":integer,
			"PoolShare": integer,
			"version": 1,
			"PoolName": "string",
		},
		"signature":"string"
	},
	"txid": "string",
	"block": integer,
	"block-time": integer
},
{...}

Register New Autominer-Pool

Flo Network Mining Info

Retrieves the current list of all registered Autominer-Pools.

HTTP Request

Parameters

n/a

Result

{
	"blocks": integer,
	"currentblocksize": integer,
	"currentblocktx": integer,
	"difficulty": float,
	"errors": "",
	"generate": boolean,
	"genproclimit": -1,
	"hashespersec": integer,
	"networkhashps": integer,
	"pooledtx": integer,
	"testnet": boolean
}

Historian Summary

Retrieves the list of all artifacts which match the search criteria.

HTTP Request

Parameters

  • No parameters are required, if none are included 10K data-points will be returned, sorted from most recent to oldest

Optional Parameters

Parameter Description Example(s)
data-points int, number of data-points to return 25
min-block int, block to start search range 2536989
max-block int, block to end search range 2541967
min-time int, unixtime of start search range 1461098486
max-time int, unixtime of end search range 1472098486

Result

{
    "averages": {
        "mrr_last_10": floating-point number,
        "mrr_last_24hr": floating-point number,
        "pool_hashrate": floating-point number,
        "fbd_networkhashps": floating-point number,
        "fmd_weighted": floating-point number,
        "fmd_usd": floating-point number,
        "ltc_usd": floating-point number,
        "flo_spotcost_btc": floating-point number,
        "flo_spotcost_usd": floating-point number,
        "offer_btc": floating-point number,
        "offer_usd": floating-point number,
        "pool_margin": integer
    },
    "data-points": [ 
        { 
            "block": integer, 
            "blockTime": 10-digit-integer, 
            "url_of_node_or_pool": "string", 
            "mrr_last_10": floating-point number, 
            "mrr_last_24hr": floating-point number, 
            "pool_hashrate": floating-point number,
            "fbd_networkhashps": floating-point number,
            "fmd_weighted": floating-point number,
            "fmd_usd": floating-point number,
            "ltc_usd": floating-point number,
            "flo_spotcost_btc": floating-point number,
            "flo_spotcost_usd": floating-point number,
            "offer_btc": floating-point number,
            "offer_usd": floating-point number,
            "pool_margin": floating-point number
        },
        {...}
    ]
}

TradeBot

TradeBot Get Available FLO

Retrieves the current mining information for FLO.

HTTP Request

Parameters

n/a

Results

floating-point number

TradeBot Get BTC Address

Retrieves a BTC address to trade for FLO.

HTTP Request

Optional Parameters

Parameter Description
&raw Include to deliver raw json only, without HTML & JS for QR code

Results

string  

or, without "&raw", results will be html, like this example: (click Expand) ->

Mining Info

Retrieves the current mining information for FLO.

HTTP Request

Parameters

n/a

Result

{
    "blocks": integer,
    "currentblocksize": integer,
    "currentblocktx": integer,
    "difficulty": floating-point number,
    "errors": "",
    "generate": false,
    "genproclimit": -1,
    "hashespersec": floating-point number,
    "networkhashps": integer,
    "pooledtx": 2,
    "testnet": boolean
}

Market Info

Retrieves the current exchange price information for FLO.

HTTP Request

Parameters

n/a

Result

{
    "unixtime": 10 digit integer,
    "cryptsy": "floating-point number",
    "poloniex": "floating-point number",
    "bittrex": "floating-point number",
    "daily-volume": "floating-point number",
    "weighted": "floating-point number",
    "USD": "floating-point number"
}

TX-Comment Search

Retrieves the list of all artifacts which match the search criteria.

HTTP Request

Parameters

Parameter Description Example(s)
search string, search term bitcoin
results-per-page integer 10
page integer, which page (starting at 0) 2536989
  • Search is not a required term, without it the most recent tx-comments in the blockchain will be returned

Result

[
    {
        "Hash": "string",
        "Message": "string"
    },
    {...}
]

Notes

  1. 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 To use OIP with zero central points of failure, you'll need OIP Daemon.
  2. To look this data up locally, you'll need flo-market-data.