AAlle von Weaver bereitgestellten Funktionen, einschließlich Authentifizierung, Empfang von Ökosystemdaten, Fehlerbehandlung, Datenbanktabellenoperationen, Seiten- und Vertragsimplementierung, sind über die REST-API von IBAX verfügbar.
Mit der REST-API können Entwickler auf alle Plattformfunktionen zugreifen, ohne Weaver zu verwenden.
API-Befehlsaufrufe werden durch Adressieren von /api/v2/command/[param] ausgeführt, wobei command der Befehlsname und param ein zusätzlicher Parameter ist. Die Anfrageparameter müssen im Format Content-Type: x-www-form-urlencoded gesendet werden. Das Ergebnis der Serverantwort liegt im JSON-Format vor.
-
- Ökosystemname
- Ökosysteme
- appparams/{appID}
- appparam/{appid}/{name}
- Ökosystemparameter
- Ökosystemparam/{Name}
- tables/[?limit=…&offset=…]
- Tabelle/{Name}
- list/{name}[?limit=…&offset=…&columns=…]
- sections[?limit=…&offset=…&lang=]
- row/{name}/{id}[?columns=]
- row/{name}/{column}/{id}
- Systemparameter
- Geschichte/{Name}/{ID}
- interface/{page|menu|block}/{name}
Wenn die Anfrage erfolgreich ausgeführt wird, wird ein Statuscode 200 zurückgegeben. Tritt ein Fehler auf, wird zusätzlich zum Fehlerstatus ein JSON-Objekt mit folgenden Feldern zurückgegeben:
- Error
Fehlerkennung.
- Nachricht
Der im Fehlerfall zurückgegebene Text.
- Parameter
Zusätzliche Parameter des Fehlers, die im Fehlerfall im zurückgegebenen Text enthalten sein können.
Response example
400 (Bad request)
Content-Type: application/json
{
"err": "E_INVALIDWALLET",
"msg": "Wallet 1234-5678-9012-3444-3488 is not valid",
"params": ["1234-5678-9012-3444-3488"]
}
E_CONTRACT
No `%s` contract exists
E_DBNIL
Leere Datenbank
E_DELETEDKEY
Kontoadresse gesperrt
E_ECOSYSTEM
Ökosystem `%d` existiert nicht
E_EMPTYPUBLIC
Ungültiger öffentlicher Schlüssel für das Konto
E_KEYNOTFOUND
Kontoadresse nicht gefunden
E_HASHWRONG
Falscher Hash
E_HASHNOTFOUND
Nicht gefunden
E_HEAVYPAGE
Zu viele Seiten geladen
E_INVALIDWALLET
Ungültige Wallet-Adresse `%s`
E_LIMITTXSIZE
Größe einer Transaktion außerhalb des Limits
E_NOTFOUND
Seiten- oder Menüinhalt nicht gefunden
E_PARAMNOTFOUND
Parameter nicht gefunden
E_PERMISSION
Keine Erlaubnis
E_QUERY
Datenbankabfragefehler
E_RECOVERED
Die API hat einen Panikfehler.
Gibt einen Fehler zurück, wenn ein Panikfehler vorliegt.
Es bedeutet, dass Sie auf einen Fehler gestoßen sind, der lokalisiert und behoben werden muss.
E_SERVER
Serverfehler.
Wenn es einen Fehler in der golang-Bibliotheksfunktion gibt, kehrt sie zurück. Das msg-Feld enthält den im Fehlerfall zurückgegebenen Text.
Als Antwort auf jeden Befehl kann ein **E_SERVER**-Fehler auftreten. Wenn es aufgrund falscher Eingabeparameter auftritt, können Sie es in einen verwandten Fehler ändern. In einem anderen Fall meldet dieser Fehler einen ungültigen Betrieb oder eine falsche Systemkonfiguration, was einen detaillierteren Untersuchungsbericht erfordert.
E_SIGNATURE
Falsche Signatur
E_STATELOGIN
`%s` ist kein Mitglied des Ökosystems `%s`
E_TABLENOTFOUND
Tabelle `%s` nicht gefunden
E_TOKENEXPIRED
Sitzung `%s` ist abgelaufen
E_UNAUTHORIZED
Unbefugt.
Wenn Sie nicht angemeldet sind oder die Sitzung abgelaufen ist, gibt jeder Befehl außer `getuid, login` einen
E_UNAUTHORIZED-Fehler zurück.
E_UNKNOWNUID
Unbekannte UID
E_UPDATING
Der Knoten aktualisiert die Blockchain
E_STOPPING
Der Knoten wurde gestoppt
E_NOTIMPLEMENTED
Noch nicht implementiert
E_BANNED
Die Kontoadresse ist in `%s` verboten
E_CHECKROLE
Zugriff verweigert
APIs sind für CLB nicht verfügbar
Schnittstellenanforderung für den CLB-Knoten nicht verfügbar:
- Metriken
- txinfo
- txinfoMultiple
- appparam
- appparams
- App-Inhalt
- Geschichte
- Balance
- Block
- maxblockid
- Blöcke
- detaillierte Blöcke
- Ökosystemparameter
- Systemparameter
- Ökosysteme
- Ökosystemparam
- Ökosystemname
- Brieftaschenverlauf
- tx_record
Uniform use
- application/x-www-form-urlencoded
JWT-Token wird zur Authentifizierung verwendet. Nach Erhalt des JWT-Tokens muss es in jedem Request-Header platziert werden: Authorization: Bearer TOKEN_HERE.
GET/ returns a unique value, signs it with the private key, and then uses The login command sends it back to the server.
Generate a temporary JWT token that needs to be passed to Authorization when calling login.
Request
GET
/api/v2/getuid
Response
-
uidSignature number.
-
tokenThe temporary token passed during login.
The life cycle of a temporary token is 5 seconds.
-
network_idServer identifier.
-
cryptoerElliptic curve algorithm.
-
hasherhash algorithm.
Response Example 1
200 (OK)
Content-Type: application/json
```json
{
"uid": "4999317241855959593",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....... .I7LY6XX4IP12En6nr8UPklE9U4qicqg3K9KEzGq_8zE"
"network_id": "4717243765193692211"
}
In the case that no authorization is required (the request contains Authorization), the following message will be returned:
-
expireExpiration time.
-
ecosystemEcosystem ID.
-
key_idAccount address.
-
addressWallet address
XXXX-XXXX-..... -XXXX. -
network_idServer identifier.
Response Example 2
200 (OK)
Content-Type: application/json
{
"expire": "2159h59m49.4310543s",
"ecosystem_id": "1",
"key_id": "-654321",
"address": "1196-...... -3496",
"network_id": "1"
}
Error Response
E_SERVER
POST/ Authentifizierung der Benutzeridentität.
Der Befehl getuid sollte zuerst aufgerufen werden, um einen eindeutigen Wert zu erhalten und ihn zu signieren. Das temporäre JWT-Token von getuid muss im Anforderungsheader übergeben werden.
Wenn die Anfrage erfolgreich war, wird das in der Antwort erhaltene Token in Autorisierung aufgenommen. Anfrage
POST /api/v2/login
-
ecosystemÖkosystem-ID.
Wenn nicht angegeben, ID des ersten Ökosystems standardmäßig.
-
expireLebensdauer des JWT-Tokens in Sekunden, standardmäßig 28800.
-
pubkeyHexadezimaler öffentlicher Schlüssel des Kontos.
-
key_idKontoadresse
XXXX-...-XXXX.Verwenden Sie diesen Parameter, wenn der öffentliche Schlüssel bereits in der Blockchain gespeichert ist. Es kann nicht gleichzeitig mit dem Pubkey-Parameter verwendet werden.
-
signatureUID-Signatur erhalten über getuid.
Response
-
tokenJWT-Token.
-
ecosystem_idÖkosystem-ID.
-
key_idKontoadressen-ID
-
accountWallet-Adresse
XXXX-...-XXXX. -
notify_keyBenachrichtigungs-ID.
-
isnodeOb die Kontoadresse der Besitzer des Knotens ist. Wert:
true, false. -
isownerOb die Kontoadresse der Ersteller des Ökosystems ist. Wert:
true, false. -
clbOb das registrierte Ökosystem CLB ist. Wert:
true, false. -
rolesOmitemptyRole list:
[{Role ID,Role Name}].
Response Example
200 (OK)
Content-Type: application/json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.....30l665h3v7lH85rs5jgk0",
"ecosystem_id": "1",
"key_id": "-54321",
"account": "1285-... -7743-4282",
"notify_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..... _JTFfheD0K4CfMbvVNpOJVMNDPx25zIDGir9g3ZZM0w",
"timestamp": "1451309883",
"roles": [
{
"role_id": 1,
"role_name": "Developer"
}
]
}
Error Response
E_SERVER, E_UNKNOWNUID, E_SIGNATURE, E_STATELOGIN, E_EMPTYPUBLIC
GET/ Gibt die Version des aktuellen Servers zurück.
Für diese Anfrage ist keine Anmeldeberechtigung erforderlich.
Anfrage
GET /api/v2/version
Request
GET
/api/v2/version
Response Example
200 (OK)
Content-Type: application/json
"1.3.0 branch.main commit.790..757 time.2021-08-23-08:20:19(UTC)"
GET/ Fordern Sie den Kontostand der Kontoadresse im aktuellen Ökosystem an.
Request
Request
GET
/api/v2/balance/{wallet}
wallet
Adresskennung. Sie können es in einem beliebigen Format int64, uint64, XXXX-...-XXXX angeben. Diese Adresse wird in dem Ökosystem abgefragt, in dem der Benutzer gerade angemeldet ist.
Response
-
amountThe minimum unit of contract account balance.
-
moneyAccount balance.
-
totalAccount balance.
-
utxoUTXO account balance.
Response Example
200 (OK)
Content-Type: application/json
{
"amount": "877450000000000",
"money": "877.45",
"total": "877450000000000",
"utxo": "0"
}
Error Response
E_SERVER, E_INVALIDWALLET
GET/ gibt eine Liste zurück, die zusätzliche Informationen zu Transaktionen in jedem Block enthält. Für diese Anfrage ist keine Anmeldeberechtigung erforderlich.
Request
GET
/api/v2/blocks
-
block_idOmitempty Default is 0The height of the starting block to query.
-
countOmitempty (default is 25, max request 1000)Number of blocks.
Response
-
Block heightList of transactions in the block and additional information for each transaction.
hash
Trading Hash.
contract_name
Contract name.
params
Array of contract parameters.
key_id
For the first block, it is the account address of the first block that signed the transaction.
For all other blocks, is the address of the account that signed the transaction.
Response Example
200 (OK)
Content-Type: application/json
{ "1":
[{"hash": "O1LhrjKznrYa0z5n5cej6p5Y1j5E9v/oV27VPRJmfgo=",
"contract_name":"",
"params":null,
"key_id":-118432674655542910}]
}
Error Response
E_SERVER, E_NOTFOUND
GET/ gibt eine Liste mit detaillierten zusätzlichen Informationen zu Transaktionen in jedem Block zurück.
Für diese Anfrage ist keine Anmeldeberechtigung erforderlich.
Request
GET
/api/v2/detailed_blocks
-
block_idOmitempty Default is 0The height of the starting block to query.
-
countOmitempty (default is 25, max request 1000)Number of blocks.
Response
Block heightThe block height.blockheadThe block header contains the following fields.block_idBlock height.timeBlock generation timestamp.key_idSign the account address for the block.node_positionThe location of the node that generated the block in the honor node list.versionBlock structure version.
hashBlock Hashing.node_positionthe location of the node that generated the block in the honor node list.key_idThe address of the account that signed the block.timeBlock generation timestamp.tx_countNumber of transactions within the block.sizeThe block size.rollback_hashBlock rollback hash.merkle_rootThe block deals with the Merkle tree.bin_dataSerialization of the block header, all transactions within the block, the previous block hash, and the private key of the node that generated the block.transactionsList of transactions in the block and additional information about each transaction.hashTrading hash.contract_nameContract name.paramsContract parameters.key_idSign the account address for this transaction.timeTransaction generation timestamp.typeTransaction type.sizeTrade Size.
Response Example
200 (OK)
Content-Type: application/json
{"1":
{"header":
{"block_id":1,
"time":1551069320,
"ecosystem_id":0,
"key_id":-118432674655542910,
"node_position":0,
"version":1},
"hash":"3NxhvswmpGvRdw8HdkrniI5Mx/q14Z4d5hwGKMp6KHI=",
"ecosystem_id":0,
"node_position":0,
"key_id":-118432674655542910,
"time":1551069320,
"tx_count":1,
"size": "1.69KiB",
"rollbacks_hash":"I2JHugpbdMNxBdNW1Uc0XnbiXFtzB74yD9AK5YI5i/k=",
"mrkl_root":"MTZiMjY2NGJjOWY3MDAyODlhYjkyMDVhZDQwNDgxNzkxMjY1MWJjNjczNDkyZjk5MWI2Y2JkMjAxNTIwYjUyYg==",
"bin_data":null,
"sys_update":false,
"gen_block":false,
"stop_count":0,
"transactions":[
{
"hash":"O1LhrjKznrYa0z5n5cej6p5Y1j5E9v/oV27VPRJmfgo=",
"contract_name":"",
"params":null,
"key_id":0,
"time":0,
"type":0,
"size": "300.00B"
}
]}
}
Error Response
E_SERVER, E_NOTFOUND
GET/ If the specified hash matching the data in the binary watch, field, and records, this request will return the data. Otherwise, return error.
The request does not require login authorization.
Request
GET
/data/{id}/data/{hash}
-
idRecord ID.
-
hashHash request data.
Response
Binary data
Response Example
200 (OK)
Content-Type: *
{
"name": "NFT Miner",
"conditions": "ContractConditions(\"@1DeveloperCondition\")",
"data": [
{
"Type": "contracts",
"Name": "NewNFTMiner",
},
...
]
}
Error Response
E_SERVER, E_NOTFOUND, E_HASHWRONG
GET/ Wenn der angegebene Hash mit den Daten in der angegebenen Tabelle, dem angegebenen Feld und dem angegebenen Datensatz übereinstimmt, gibt diese Anforderung die Daten zurück. Andernfalls wird ein Fehler zurückgegeben.
Für diese Anfrage ist keine Anmeldeberechtigung erforderlich.
Request
GET
/data/{table}/id/{column}/{hash}
-
tableTabellenname.
-
idDatensatz-ID.
-
columnFeldname.
-
hashHash der angeforderten Daten.
Response Binärdaten
Response Example
200 (OK)
Content-Type: *
Content-Disposition: attachment
SetVar(this_page, @1voting_list).(this_table, @1votings)
Include(@1pager_header)
SetTitle("$@1voting_list$")
Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: "$@1votings_list_desc$"))
AddToolButton(Title: $@1templates_list$, Page: @1voting_templates_list, Icon: icon-pin)
AddToolButton(Title: $@1create$, Page: @1voting_create, Icon: icon-plus).Popup(60, $@1new_voting$)
Error Response
E_SERVER, E_NOTFOUND, E_HASHWRONG
GET/ Return to a list of ecosystems, which contains the role of registered the specified address.
The request does not require login authorization.
Request
GET
/api/v2/keyinfo/{address}
-
addressAddress identifier, you can specify
int64, uint64, xxxx -...-xxxx.This request is query in all ecosystems.
Response
-
ecosystemEcosystem ID.
-
nameEcosystem name.
-
rolesActivities with id and name fields.
Response Example
200 (OK)
Content-Type: application/json
[{
"ecosystem":"1",
"name":"platform ecosystem",
"roles":[{"id":"1","name":"Governancer"},{"id":"2","name":"Developer"}]
}]
Error Response
E_SERVER, E_INVALIDWALLET
GET/ Return to the current account transaction history record, find it according to the ID of the ID
Request
-
searchTypeFind Type (Income: Turn into Outcom: Turn out all: All, default).
-
pageOmitemptyFind the number of pages, the first page default, min: 1
-
limitOmitemptyCredit number, default 20 articles. min: 1, MAX: 500
GET
/api/v2/walletHistory?searchType=all&page=1&limit=10
Response
-
totalTotal number of entries.
-
pageNumber of current page.
-
limitCurrently find the number of bars.
-
listEach element in the array contains the following parameters:idStripe ID.sender_idSend key_idsender_addSend the account addressrecipient_idAccept key_idrecipient_addAccept the account addressamountTransaction amountcommentTrading remarksblock_idBlock heighttx_hashTrading hashcreated_atTransaction creation time, millisecond time stampmoneyTransaction amount
Response Example
200 (OK)
Content-Type: application/json
{
"page": 1,
"limit": 10,
"total": 617,
"list": [
{
"id": 650,
"sender_id": 666081971617879...,
"sender_add": "0666-0819-7161-xxxx-5186",
"recipient_id": 666081971617879...,
"recipient_add": "0666-0819-7161-xxxx-5186",
"amount": "242250000",
"comment": "taxes for execution of @1Export contract",
"block_id": 209,
"tx_hash": "a213bc767d710a223856d83515d53518075b56fb9e9c063bce8a256c20ff0775",
"created_at": 1666001092090,
"money": "0.00024225"
}
...
]
}
Error Response
E_SERVER
GET/ Return to the entry of the data table specified in the current ecosystem. You can specify columns to be returned.
Request
-
nameData table name.
-
limitOmitemptyCredit number, default 25.
-
offsetOmitemptyDisposal, default to 0.
-
orderOmitemptySorting method, default
id ASC. -
columnsOmitemptyThe list of request columns is separated by commas. If it is not specified, all columns will be returned. In all cases, the
idcolumn will be returned. -
whereOmitemptyQuery condition
Example: If you want to query id> 2 and name = john
You can use: where: {"id": {"$ gt": 2}, "name": {"$eq": "john"}}
For details, please refer to [DBFind](../ topics/script.md#dbfind) where syntax
GET
/api/v2/listWhere/mytable
Response
-
countTotal number of entries.
-
listEach element in the array contains the following parameters:
idStripe ID.
...Data tables other columns
Response Example
200 (OK)
Content-Type: application/json
{
"count": 1,
"list": [
{
"account": "xxxx-0819-7161-xxxx-xxxx",
"ecosystem": "1",
"id": "12",
"key": "avatar",
"value": "{\"binary_id\": 4}"
}
]
}
Error Response
E_SERVER,E_TABLENOTFOUND
GET/ Return to the specified data table. You can specify columns to be returned. The type in the data table is BYTEA Do hexadecimal encoding processing
Request
-
nameData table name.
-
limitOmitemptyCredit number, default 25.
-
offsetOmitemptyDisposal, default to 0.
-
orderOmitemptySorting method, default
id ASC. -
columnsOmitemptyThe list of request columns is separated by commas. If it is not specified, all columns will be returned. In all cases, the
idcolumn will be returned. -
whereOmitemptyQuery condition
Example: If you want to query id> 2 and name = john
You can use: where: {"id": {"$ gt": 2}, "name": {"$eq": "john"}}
For details, please refer to [DBFind](../ topics/script.md#dbfind) where syntax
GET
/api/v2/nodelistWhere/mytable
Response
-
countTotal number of entries.
-
listEach element in the array contains the following parameters:
idStripe ID.
...Data tables other columns
Response Example
200 (OK)
Content-Type: application/json
{
"count": 1,
"list": [
{
"account": "xxxx-0819-7161-xxxx-xxxx",
"ecosystem": "1",
"id": "12",
"key": "avatar",
"value": "{\"binary_id\": 4}"
}
]
}
Error Response
E_SERVER,E_TABLENOTFOUND
GET/ Returns the number of ecosystem 1 account addresses.
Request
GET
/api/v2/metrics/keys
Response Example
200 (OK)
Content-Type: application/json
{
"count": 28
}
GET/ Returns the number of blocks.
Request
GET
/api/v2/metrics/blocks
Response Example
200 (OK)
Content-Type: application/json
{
"count": 28
}
GET/ Returns the total number of transactions.
Request
GET
/api/v2/metrics/transactions
Response Example
200 (OK)
Content-Type: application/json
{
"count": 28
}
GET/ Returns the number of ecosystems.
Request
GET
/api/v2/metrics/ecosystems
Response Example
200 (OK)
Content-Type: application/json
{
"count": 28
}
GET/ Returns the number of honor nodes.
This request does not require login authorization.
GET
/api/v2/metrics/honornodes
Response Example
200 (OK)
Content-Type: application/json
{
"count": 28
}
GET/ Returns the name of the ecosystem by its identifier.
This request does not require login authorization.
GET
/api/v2/ecosystemname?id=1
-
id
Ecosystem ID.
Response Example
200 (OK)
Content-Type: application/json
{
"ecosystem_name": "platform_ecosystem"
}
Error Response
E_PARAMNOTFOUND
GET/ Returns a list of application parameters in the current or specified ecosystem.
Request
GET
/api/v2/appparams/{appid}
-
appidApplication ID.
-
ecosystemEcosystem ID; if not specified, the current ecosystem parameter will be returned.
-
namesThe list of received parameters.
You can specify a comma-separated list of parameter names, for example:
/api/v2/appparams/1?names=name,mypar.
Response
-
listEach element of the array contains the following parameters.
name, the name of the parameter.value, the value of the parameter.conditions, change the permissions of the parameters.
Response Example
200 (OK)
Content-Type: application/json
{
"list": [{
"name": "name",
"value": "MyState",
"conditions": "true",
},
{
"name": "mypar",
"value": "My value",
"conditions": "true",
},
]
}
Error Response
E_ECOSYSTEM
GET/ Gibt Informationen zurück, die sich auf den Parameter {name} der Anwendung {appid} im aktuellen oder angegebenen Ökosystem beziehen. Anfrage
GET /api/v2/appparam/{appid}/{name}[?ecosystem=1]
-
appidAnwendung ID.
-
nameName des angeforderten Parameters.
-
ecosystemOmitempty
Ökosystem-ID (optionaler Parameter). Gibt standardmäßig das aktuelle Ökosystem zurück.
Response
-
Ich würde
Parameter-ID.
-
Name
Parametername.
-
Wert
Parameterwert.
-
Bedingungen
Berechtigung zum Ändern von Parametern.
Response Example
200 (OK) Inhaltstyp: application/json
{
"id": "10",
"name": "par",
"value": "My value",
"conditions": "true"
}Error Response E_ECOSYSTEM, E_PARAMNOTFOUND
Authorization GET/ Gibt die Liste der Ökosystemparameter zurück.
Request
GET /api/v2/ecosystemparams/[?ecosystem=...&names=...]
-
ecosystemOmitemptyÖkosystem-ID. Wenn nicht angegeben, wird die aktuelle Ökosystem-ID zurückgegeben.
-
namesOmitempty Liste der Anforderungsparameter, durch Kommas getrennt.Zum Beispiel:
/api/v2/ecosystemparams/?names=name,currency,logo.
Response
-
list -
listEach element of the array contains the following parameters.
name
Parameter name.
value
Parameter value.
conditions
Change permissions for parameters.
Response Example
200 (OK)
Inhaltstyp: application/json
```json
{
"list": [{
"name": "name",
"value": "MyState",
"conditions": "true",
},
{
"name": "currency",
"value": "MY",
"conditions": "true",
},
]
}
Error Response
E_ECOSYSTEM
GET/ Gibt Informationen zum Parameter {Name} im aktuellen oder angegebenen Ökosystem zurück.
Request
GET /api/v2/ecosystemparam/{name}[?ecosystem=1]
-
nameName des Anforderungsparameters.
-
ecosystemSie können die Ökosystem-ID angeben. Standardmäßig wird die aktuelle Ökosystem-ID zurückgegeben.
Response
-
nameParametername.
-
valueParameterwert.
-
conditionsBerechtigung zum Ändern der Parameter.
Response Example 200 (OK) Inhaltstyp: application/json
{
"name": "currency",
"value": "MYCUR",
"conditions": "true"
}Error Response
E_ECOSYSTEM
GET/ Gibt die Liste der Tabellen des aktuellen Ökosystems zurück, in der Sie den Offset und die Anzahl der Einträge festlegen können.
Request
GET /api/v2/tables
-
countGesamteinträge in der Tabelle.
-
listJedes Element im Array enthält die folgenden Parameter:
-
name
Tabellenname ohne Präfix.
-
count
Anzahl der Einträge in der Tabelle.
-
Response Example
200 (OK)
Inhaltstyp: application/json
{
"count": "100",
"list": [{
"name": "accounts",
"count": "10"
},
{
"name": "citizens",
"count": "5"
}
]
}GET/ Returns information about the current ecosystem request data table.
Request
-
nameData table name.
GET
/api/v2/table/{table_name}
Returns the following field information.
-
nameTabellenname ohne das Ökosystempräfix.
-
insertBerechtigung zum Hinzufügen neuer Einträge.
-
new_columnBerechtigung zum Hinzufügen neuer Felder.
-
updateBerechtigung zum Ändern von Einträgen.
-
conditions
Berechtigung zum Ändern der Tabellenkonfiguration.
-
columnsArray of field-related information.
name
Field name.
type
Field data type.
perm
Change the permissions for the field value.
GET/ Returns a list of the specified data table entries in the current ecosystem. You can set the offset and the number of entries.
Request
-
nameData table name.
-
limitOmitemptyNumber of entries, default 25 entries.
-
offsetOmitemptyOffset, default is 0.
-
columnsOmitemptyA comma-separated list of requested columns, if not specified, all columns will be returned. The id column will be returned in all cases.
GET
/api/v2/list/mytable?columns=name
Response
-
countTotal number of entries.
-
listEach element of the array contains the following parameters.
id
Entry ID.
- The sequence of request columns.
Response Example
200 (OK)
Content-Type: application/json
{
"count": "10"
"list": [{
"id": "1",
"name": "John",
},
{
"id": "2",
"name": "Mark",
},
]
}
GET/ Returns the sections of the current ecosystem List of table entries, you can set the offset and the number of entries.
If role_access field contains a list of roles and does not include the current role, no record will be returned. title The data in the field will be replaced by the Accept-Language language resource in the request header.
Request
-
limitOmitemptyNumber of entries, default 25 entries.
-
offsetOmitemptyOffset, default is 0.
-
langOmitemptyThis field specifies the multilingual resource code or localization, e.g., en, de. If the specified multilingual resource is not found, e.g., en-US, then the multilingual resource group in Search in en.
GET
/api/v2/sections
Response
-
countsections Total number of table entries.
-
listEach element of the array contains information about all columns in the actions table.
Response Example
200 (OK)
Inhaltstyp: application/json
{
"count": "2",
"list": [{
"id": "1",
"title": "Development",
"urlpage": "develop",
...
},
]
}
Error Response
E_TABLENOTFOUND
GET/ Gibt den Eintrag der angegebenen Tabelle im aktuellen Ökosystem zurück. Sie können die zurückzugebende(n) Spalte(n) angeben.
Request
-
nameTabellenname.
-
idEintrags-ID.
-
columnsOmitemptyListe der angeforderten Spalten, getrennt durch Kommas. Wenn nicht angegeben, werden alle Spalten zurückgegeben. In allen Fällen wird die ID-Spalte zurückgegeben.
GET
/api/v2/row/mytable/10?columns=name
Response
-
valueEin Array von Werten der angeforderten Spalten
-
id Eintrags-ID.
-
Reihenfolge der angeforderten Spalten.
-
Response Example
200 (OK)
Inhaltstyp: application/json
{
"values": {
"id": "10",
"name": "John"
}
}Error Response
E_NOTFOUND
[Authorization] (#authorization)
GET/ Return to the entry of the data table specified in the current ecosystem. You can specify columns to be returned.
Request
-
NameData table name.
-
colornData list name.
-
IDStripe ID.
-
columns[omitempty] (#omitempty)The list of request lists is separated by commas. If it is not specified, all columns will be returned. In all cases, the ID column will be returned.
GET
/API/V2/ROW/MyTable/name/John? Columns = name
`` `
**Response**
- `Value`
> Array of receiving column values
Forecast
> - `ID`
>>
>>> Strip ID.
>>
> - -The sequence of the request column.
**Response Example**
```text
200 (OK)
Content-type: Application/JSON
{{
"Values": {
"ID": "10",
"name": "John",
}
}
Error Response
E_NOTFOUND
GET/ Returns a list of platform parameters.
Request
GET
/api/v2/systemparams/[?names=...]
-
namesOmitemptyA list of request parameters, separated by commas. For example
/api/v2/systemparams/?names=max_columns,max_indexes.
Response
-
listEach element of the array contains the following parameters.
name
Parameter name.
value
Parameter values.
conditions
Change the permission of the parameter.
Response Example
200 (OK)
Inhaltstyp: application/json
```json
{
"list": [{
"name": "max_columns",
"value": "100",
"conditions": "ContractAccess("@1UpdateSysParam")",
},
{
"name": "max_indexes",
"value": "1",
"conditions": "ContractAccess("@1UpdateSysParam")",
},
]
}
Error Response
E_PARAMNOTFOUND
GET/ Returns the change record for the entry in the specified data table in the current ecosystem.
Request
GET
/api/v2/history?name=contracts&id=5
nameData Table Name.
idEntry ID.
Response
listEach element of the array contains a change record for the requested entry.
Response Example
200 (OK)
Inhaltstyp: application/json
```json
{
"list": [
{
"name": "default_page",
"value": "P(class, Default Ecosystem Page)"
},
{
"menu": "default_menu"
}
]
}
GET/ Returns the current ecosystem in the specified data table (pages, menu or snippet) name The entry for the field.
GET
/api/v2/interface/page/default_page
/api/v2/interface/menu/default_menu
/api/v2/interface/snippet/welcome
Request
-
nameName des in der Tabelle angegebenen Eintrags.
-
idEintrags-ID.
-
nameEintragsname.
-
otherAndere Spalten der Tabelle.
Response Example
200 (OK)
Inhaltstyp: application/json
{
"id": "1",
"name": "default_page",
"value": "P(Page content)",
"default_menu": "default_menu",
"validate_count": 1
}Error Response
E_QUERY, E_NOTFOUND
Authorization GET/ Gibt die Liste der Verträge im aktuellen Ökosystem zurück und kann den Offset und die Anzahl der Einträge festlegen.
Request
-
limitAnzahl der Einträge, standardmäßig 25.
-
offsetOffset, standardmäßig 0.
GET /api/v2/contracts
Response
-
countTotal number of entries.
-
listEach element of the array contains the following parameters.
id
Contract ID.
name
Contract name.
value
Contract contents.
wallet_id
The account address to which the contract is tied.
address
Contract-bound wallet address
XXXX-... -XXXX.ecosystem_id
The ecosystem ID to which the contract belongs.
app_id
The application ID to which the contract belongs.
conditions
Change the permission of the contract.
token_id
The ID of the ecosystem where the pass is used to pay the contract fee.
Response Example
200 (OK)
Inhaltstyp: application/json
{
"count": "10"
"list": [{
"id": "1",
"name": "MainCondition",
"token_id":"1",
"wallet_id":"0",
"value": "contract MainCondition {
conditions {
if(EcosysParam(`founder_account`)!=$key_id)
{
warning `Sorry, you dont have access to this action.`
}
}
}",
"address":"0000-0000-0000-0000-0000",
"conditions":"ContractConditions(`MainCondition`)"
},
...
]
}
GET/ Gibt die relevanten Informationen des angegebenen Vertrags zurück. Standardmäßig wird der Vertrag im aktuellen Ökosystem abgefragt.
Request
-
nameContract name.
GET
/api/v2/contract/mycontract
Response
-
idVertrags-ID in VM.
-
nameVertragsname „@1MainCondition“ mit der Ökosystem-ID.
-
stateID des Ökosystems, zu dem der Vertrag gehört.
-
walletidAn den Vertrag gebundene Kontoadresse.
-
tokenidAls ID des Ökosystems, in dem sich der Token befindet, der zur Zahlung der Vertragsgebühr verwendet wird.
-
addressAn den Vertrag gebundene Wallet-Adresse
XXXX-...-XXXX. -
tableidEintrags-ID des Vertrags in der Vertragstabelle.
-
fieldsThe array contains structural information for each parameter of the contract data section.
name
Parameter name.
typeParameter type.
optional
Parameter options, `true` means optional parameters, `false` means mandatory parameters.
Response Example
200 (OK)
Inhaltstyp: application/json
{
"fields" : [
{"name":"amount", "type":"int", "optional": false},
{"name":"name", "type":"string", "optional": true}
],
"id": 150,
"name": "@1mycontract",
"tableid" : 10
}Error Response
E_CONTRACT
POST/ Empfangen Sie die Transaktion im Parameter und fügen Sie sie der Transaktionswarteschlange hinzu. Wenn die Anfrage erfolgreich ausgeführt wird, wird der Transaktions-Hash zurückgegeben. Mit dem Hash erhalten Sie die entsprechende Transaktion im Block. Wenn eine Fehlerantwort auftritt, wird der Hash in die Fehlertextnachricht eingefügt.
Request
tx_key
Transaktionsinhalt. Sie können einen beliebigen Namen angeben und unterstützen den Empfang mehrerer Transaktionen mit diesem Parameter. POST /api/v2/sendTx
Headers:
Content-Type: multipart/form-data
Parameters:
tx1 - transaction 1
txN - transaction N
Response
-
hashesTransaction hash arrays.
tx1
Trading 1 hash.
txN
Trading N's hash.
Response Example
200 (OK) Inhaltstyp: application/json
{
"hashes": {
"tx1": "67afbc435634.....",
"txN": "89ce4498eaf7....."
}
}Error Response
E_LIMITTXSIZE,E_BANNED
POST/ Returns the block ID and error message for the specified transaction hash. If the return values for the block ID and error text message are null, then the transaction is not yet contained in the block.
Request
-
dataJSON list of transaction hashes.
{"hashes":["contract1hash", "contract2hash", "contract3hash"]}
POST
/api/v2/txstatus/
Response
-
resultsThe transaction hash is used as the key and the transaction detail is used as the value in the data dictionary.
hashTrading Hash.
blockid
If the transaction execution succeeds, the block ID is returned; if the transaction execution fails, the
blockidfor [0]{.title-ref}.result
Returns the result of the transaction via the $result variable.
errmsg
Returns an error text message if the execution of the transaction fails.
Response Example 200 (OK)
Inhaltstyp: application/json
{"results":
{
"hash1": {
"blockid": "3123",
"result": ""
},
"hash2": {
"blockid": "3124",
"result": ""
}
}
}Error Response
E_HASHWRONG, E_HASHNOTFOUND
GET/ Gibt die Informationen des angegebenen Hashs zurück, die mit der Transaktion korrelieren, einschließlich der Block-ID und der Anzahl der Bestätigungen. Wenn optionale Parameter angegeben werden, können auch der Vertragsname und zugehörige Parameter zurückgegeben werden.
Request
-
hash
Transaktionshash.
-
contractinfoOmitempty
Detaillierte Kennung des Vertragsparameters. Um Vertragsdetails zu erhalten, die sich auf die Transaktion beziehen, geben Sie contractinfo=1 an.
GET /api/v2/txinfo/c7ef367b494c7ce855f09aa3f1f2af7402535ea627fa615ebd63d437db5d0c8a?contractinfo=1
-
blockidEnthält die Block-ID der Transaktion. Wenn der Wert
0ist, kann keine Transaktion mit diesem Hash gefunden werden. -
confirmAnzahl der Bestätigungen des Blocks blockid.
-
dataOmitemptyWenn
contentinfo=1angegeben ist, werden die Vertragsdetails an diesen Parameter zurückgegeben.
Response Example 200 (OK)
Inhaltstyp: application/json
{
"blockid": "9",
"confirm": 11,
"data": {
"block": "9",
"contract": "@1NewContract",
"params": {
"ApplicationId": 1,
"Conditions": "true",
"Value": "contract crashci4b {\n\t\t\tdata {}\n\t\t}"
}
}
}Error Response
E_HASHWRONG
GET/ Gibt die Informationen des angegebenen Hashs zurück, die mit einer Transaktion korrelieren.
Request
-
datahashes
A list of transaction hashes.
-
contractinfoOmitemptyDetaillierte Kennung des Vertragsparameters. Um Vertragsdetails in Bezug auf die Transaktion zu erhalten, geben Sie
contractinfo=1an.
data: {"hashes":["contract1hash", "contract2hash", "contract3hash"]}
GET
/api/v2/txinfoMultiple
Response
-
resultsIm Datenwörterbuch Transaktions-Hashes als Schlüssel und Transaktionsdetails als Wert.
- hash
Transaktionshash.
- blockid
Block-ID, die die Transaktion enthält. Wenn der Wert
0ist, kann keine Transaktion mit diesem Hash gefunden werden.- confirm
Anzahl der Bestätigungen des Blocks blockid.
- date
Wenn
contentinfo=1angegeben ist, werden die Vertragsdetails an diesen Parameter zurückgegeben.
Response Example
200 (OK)
Inhaltstyp: application/json
{"results":
{
"hash1": {
"blockid": "3123",
"confirm": "5"
},
"hash2": {
"blockid": "3124",
"confirm": "3"
}
}
}Error Response
E_HASHWRONG
GET/ Gibt die Anzahl der Knoten zurück, die zum Überprüfen der angegebenen Seite erforderlich sind.
Request
-
namePage name with ecosystem ID in the format
@ecosystem_id%%page_name%, for example@1main_page. If you don't have an ecosystem ID, then search in the first ecosystem page by default
GET
/api/v2/page/validators_count/@2page_name
Response
-
validate_countSpecifies the number of nodes to be validated for the page.
Response Example
200 (OK)
Content-Type: application/json
{"validate_count":1}
Error Response
E_NOTFOUND, E_SERVER
Authorization POST/ Gibt den JSON-Objektbaum des Codes der angegebenen Seite oder des Menünamens zurück, der das Ergebnis der Vorlagen-Engine-Verarbeitung ist.
Request
-
nameSeiten- oder Menüname. `` text POST /api/v2/content/page/default
**Response**
- `menu` || `title`
Menüname der Seite bei Anforderung von Inhalt/Seite/…
- `menutree`
Ein JSON-Objektbaum des Seitenmenüs beim Anfordern von Inhalt/Seite/…
- `title` --head for the menu *content/menu/\...*
Menüname bei Anforderung von Inhalt/Menü/...
- `tree`
Ein JSON-Objektbaum einer Seite oder eines Menüs.
**Response Example**
200 (OK)
Inhaltstyp: application/json
```json
{
"tree": {"type":"......",
"children": [
{...},
{...}
]
},
}
Error Response
E_NOTFOUND
POST
Returns a tree of coded JSON objects for the specified page name. Does not execute any functions or receive any data. The returned JSON object tree corresponds to the page template and can be used in the visual page designer. If the page is not found, a 404 error is returned.
Request
-
namePage name with ecosystem ID in the format
@ecosystem_id%%page_name%, for example@1main_page. If no ecosystem ID is included, then search for the current eco-page by default.
Response
POST
/api/v2/content/source/default
-
treeJSON object tree of the page.
Response Example
200 (OK)
Content-Type: application/json
{
"tree": {"type":"......" ,
"children": [
{...} ,
{...}
]
},
}
Error Response
E_NOTFOUND, E_SERVER
POST
Returns a SHA256 hash of the specified page name, or a 404 error if the page cannot be found.
This request does not require login authorization. To receive the correct hash when making requests to other nodes, you must also pass
ecosystem,keyID,roleID,isMobile
parameter. To receive pages from other ecosystems, the ecosystem ID must be prefixed to the page name. For example: @2mypage.
Request
POST
/api/v2/content/hash/default
-
nameSeitenname mit der Ökosystem-ID.
-
ecosystemÖkosystem-ID.
-
keyIDKontoadresse.
-
roleIDRollen-ID.
Response
-
hashHexadezimaler Hash.
Response Example
200 (OK)
Content-Type: application/json
{
"hash": "b631b8c28761b5bf03c2cfbc2b49e4b6ade5a1c7e2f5b72a6323e50eae2a33c6"
}
Error Response
E_NOTFOUND, E_SERVER, E_HEAVYPAGE E_NOTFOUND, E_SERVER, E_HEAVYPAGE
POST
Returns the number of JSON objects for the page code from the template parameter, if the optional parameter
source is specified as
true or 1, then this JSON object tree does not perform any functions and receive data. This JSON object tree can be used in the visual page designer.
This request does not require login authorization.
Request
-
templatePage code.
-
sourceIf
true or 1is specified, the JSON object tree does not perform any functions and receives data.
POST
/api/v2/content
Response
-
treeJSON object tree.
Response Example
200 (OK)
Content-Type: application/json
{
"tree": {"type":"......" ,
"children": [
{...} ,
{...}
]
},
}
Error Response
E_NOTFOUND, E_SERVER
GET/ Gibt die ID des höchsten Blocks auf dem aktuellen Knoten zurück.
Für diese Anfrage ist keine Anmeldeberechtigung erforderlich.
Request
GET /api/v2/maxblockid
Response
max_block_id
ID des höchsten Blocks auf dem aktuellen Knoten.
Response Example
200 (OK)
Content-Type: application/json
{
"max_block_id" : 341,
}
Error Response
E_NOTFOUND
GET/ Gibt relevante Informationen des Blocks mit der angegebenen ID zurück.
Für diese Anfrage ist keine Anmeldeberechtigung erforderlich.
Request
-
idBlock ID.
POST
/api/v2/block/32
Response
-
hashHash des Blocks.
-
key_idAdresse des Kontos, das den Block signiert hat.
-
timeZeitstempel der Blockgenerierung.
-
tx_countGesamtzahl der Transaktionen im Block.
-
rollbacks_hashHash für Block-Rollback.
-
node_positionPosition des Blocks in der Liste der Ehrenknoten.
Response Example
200 (OK)
Inhaltstyp: application/json
{
"hash": "1x4S5s/zNUTopP2YK43SppEyvT2O4DW5OHSpQfp5Tek=",
"key_id": -118432674655542910,
"time": 1551145365,
"tx_count": 3,
"rollbacks_hash": "47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=",
"node_position": 0,
}
Error Response
E_NOTFOUND
GET/ Gibt den Avatar des Benutzers in der Mitgliedertabelle zurück (Sie können ihn ohne Anmeldung verwenden).
Request
-
ecosystemEcosystem ID.
-
memberThe user's account address. (xxxx-... -xxxx)
GET
/api/v2/avatar/1/1234-2134-... -4321
Response
The request header Content-Type is the image type and the image data is returned in the response body.
Response Example
200 (OK)
Content-Type: image/png
Error Response
E_NOTFOUND E_SERVER
GET/ Returns the host address and port of centrifugo.
This request does not require login authorization.
Request
GET
/api/v2/config/centrifugo
Response
Response result format http://address:port, e.g.: http://127.0.0.1:8100.
Error Response
E_SERVER
POST/ Senden Sie alle Nachrichten, die noch nicht gesendet wurden, an den Benachrichtigungsdienst von centrifugo. Senden Sie nur Nachrichten für bestimmte Ökosysteme und Mitglieder.
Für diese Anfrage ist keine Anmeldeberechtigung erforderlich.
Request
-
idKontoadresse des Mitglieds.
-
ecosystemEcosystem ID.
POST /api/v2/updnotificator
Response Example
200 (OK)
Content-Type: application/json
{
"result": true
}
If the field has an omitempty attribute, it means that the field is an optional parameter
If the interface with Authorization tag, that this interface requires login authorization, add Authorization to the request header, example.
key = Authorization value = "Bearer + login token"
Authorization Bearer eyJhbGciOiJI..... kBZgGIlPhfXNZJ73RiZtM