Skip to content

Commit

Permalink
Merge pull request #518 from shaojunda/shaojunda-add-statement-to-api…
Browse files Browse the repository at this point in the history
…-doc

[ᚬmaster] chore: add introduction to api doc
  • Loading branch information
shaojunda authored Dec 17, 2019
2 parents 4c9bd2c + 34c76a4 commit c2d57e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion doc/api.raml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ title: CKB-Explorer
version: v1
baseUri: https://explorer.nervos.org
mediaType: application/vnd.api+json

documentation:
- title: Introduction
content: |
These are the APIs that serve the Explorer, we do not provide external services and cannot guarantee service availability.
It is recommended to maintain the ckb node by yourself.
types:
indicator: {
type: string,
Expand Down
2 changes: 1 addition & 1 deletion public/api_doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
.required {
color: #f00;
}
</style></head><body data-spy="scroll" data-target="#sidebar"><div class="container"><div class="row"><div class="col-md-9" role="main"><div class="page-header"><h1>CKB-Explorer API documentation <small>version v1</small></h1><p>https://explorer.nervos.org</p></div><div class="panel panel-default"><div class="panel-heading"><h3 id="blocks" class="panel-title">/blocks</h3></div><div class="panel-body"><div class="panel-group"><div class="panel panel-white resource-modal"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_blocks"><span class="parent"></span>/blocks</a> <span class="methods"><a href="#blocks_get"><span class="badge badge_get">get</span></a></span></h4></div><div id="panel_blocks" class="panel-collapse collapse"><div class="panel-body"><div class="list-group"><div onclick="window.location.href = '#blocks_get'" class="list-group-item"><span class="badge badge_get">get</span><div class="method_description"><p>Returns blocks in reverse chronological order.</p></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="blocks_get"><div class="modal-dialog modal-lg"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_get">get</span> <span class="parent"></span>/blocks</h4></div><div class="modal-body"><div class="alert alert-info"><p>Returns blocks in reverse chronological order.</p></div><ul class="nav nav-tabs"><li class="active"><a href="#blocks_get_request" data-toggle="tab">Request</a></li><li><a href="#blocks_get_response" data-toggle="tab">Response</a></li></ul><div class="tab-content"><div class="tab-pane active" id="blocks_get_request"><h3>Query Parameters</h3><ul><li><strong>page_size</strong>: <em><span class="required">required</span>(integer - default: 10)</em></li><li><strong>page</strong>: <em><span class="required">required</span>(integer - default: 1)</em></li></ul></div><div class="tab-pane" id="blocks_get_response"><h2>HTTP status code <a href="http://httpstatus.es/200" target="_blank">200</a></h2><h3>Body</h3><p><strong>Media type</strong>: application/vnd.api+json</p><p><strong>Type</strong>: object</p><strong>Properties</strong><ul><li><strong>meta</strong>: <em><span class="required">required</span>(object)</em><ul><li><strong>total</strong>: <em><span class="required">required</span>(integer)</em></li></ul></li><li><strong>data</strong>: <em><span class="required">required</span>(array of block)</em><p><strong>Items</strong>: block</p><div class="items"><ul><li><strong>id</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>type</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>attributes</strong>: <em><span class="required">required</span>(object)</em><ul><li><strong>block_hash</strong>: <em><span class="required">required</span>(string - minLength: 66 - maxLength: 66)</em></li><li><strong>number</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>transactions_count</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>proposals_count</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>uncles_count</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>uncle_block_hashes</strong>: <em><span class="required">required</span>(array of string)</em></li><li><strong>reward</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>total_transaction_fee</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>cell_consumed</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>total_cell_capacity</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>miner_hash</strong>: <em><span class="required">required</span>(string - minLength: 66 - maxLength: 66)</em></li><li><strong>timestamp</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>difficulty</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>version</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>nonce</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>proof</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>reward_status</strong>: <em><span class="required">required</span>(one of pending, issued)</em></li><li><strong>received_tx_fee_status</strong>: <em><span class="required">required</span>(one of pending, calculated)</em></li><li><strong>received_tx_fee</strong>: <em><span class="required">required</span>(string)</em></li></ul></li></ul></div></li><li><strong>links</strong>: <em><span class="required">required</span>(object)</em><ul><li><strong>self</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>first</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>prev</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>next</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>last</strong>: <em><span class="required">required</span>(string)</em></li></ul></li></ul><p><strong>Example</strong>:</p><div class="examples"><pre><code>{
</style></head><body data-spy="scroll" data-target="#sidebar"><div class="container"><div class="row"><div class="col-md-9" role="main"><div class="page-header"><h1>CKB-Explorer API documentation <small>version v1</small></h1><p>https://explorer.nervos.org</p><h3 id="introduction"><a href="#introduction">Introduction</a></h3><p>These are the APIs that serve the Explorer, we do not provide external services and cannot guarantee service availability. It is recommended to maintain the ckb node by yourself.</p></div><div class="panel panel-default"><div class="panel-heading"><h3 id="blocks" class="panel-title">/blocks</h3></div><div class="panel-body"><div class="panel-group"><div class="panel panel-white resource-modal"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_blocks"><span class="parent"></span>/blocks</a> <span class="methods"><a href="#blocks_get"><span class="badge badge_get">get</span></a></span></h4></div><div id="panel_blocks" class="panel-collapse collapse"><div class="panel-body"><div class="list-group"><div onclick="window.location.href = '#blocks_get'" class="list-group-item"><span class="badge badge_get">get</span><div class="method_description"><p>Returns blocks in reverse chronological order.</p></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="blocks_get"><div class="modal-dialog modal-lg"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_get">get</span> <span class="parent"></span>/blocks</h4></div><div class="modal-body"><div class="alert alert-info"><p>Returns blocks in reverse chronological order.</p></div><ul class="nav nav-tabs"><li class="active"><a href="#blocks_get_request" data-toggle="tab">Request</a></li><li><a href="#blocks_get_response" data-toggle="tab">Response</a></li></ul><div class="tab-content"><div class="tab-pane active" id="blocks_get_request"><h3>Query Parameters</h3><ul><li><strong>page_size</strong>: <em><span class="required">required</span>(integer - default: 10)</em></li><li><strong>page</strong>: <em><span class="required">required</span>(integer - default: 1)</em></li></ul></div><div class="tab-pane" id="blocks_get_response"><h2>HTTP status code <a href="http://httpstatus.es/200" target="_blank">200</a></h2><h3>Body</h3><p><strong>Media type</strong>: application/vnd.api+json</p><p><strong>Type</strong>: object</p><strong>Properties</strong><ul><li><strong>meta</strong>: <em><span class="required">required</span>(object)</em><ul><li><strong>total</strong>: <em><span class="required">required</span>(integer)</em></li></ul></li><li><strong>data</strong>: <em><span class="required">required</span>(array of block)</em><p><strong>Items</strong>: block</p><div class="items"><ul><li><strong>id</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>type</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>attributes</strong>: <em><span class="required">required</span>(object)</em><ul><li><strong>block_hash</strong>: <em><span class="required">required</span>(string - minLength: 66 - maxLength: 66)</em></li><li><strong>number</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>transactions_count</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>proposals_count</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>uncles_count</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>uncle_block_hashes</strong>: <em><span class="required">required</span>(array of string)</em></li><li><strong>reward</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>total_transaction_fee</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>cell_consumed</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>total_cell_capacity</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>miner_hash</strong>: <em><span class="required">required</span>(string - minLength: 66 - maxLength: 66)</em></li><li><strong>timestamp</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>difficulty</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>version</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>nonce</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>proof</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>reward_status</strong>: <em><span class="required">required</span>(one of pending, issued)</em></li><li><strong>received_tx_fee_status</strong>: <em><span class="required">required</span>(one of pending, calculated)</em></li><li><strong>received_tx_fee</strong>: <em><span class="required">required</span>(string)</em></li></ul></li></ul></div></li><li><strong>links</strong>: <em><span class="required">required</span>(object)</em><ul><li><strong>self</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>first</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>prev</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>next</strong>: <em><span class="required">required</span>(string)</em></li><li><strong>last</strong>: <em><span class="required">required</span>(string)</em></li></ul></li></ul><p><strong>Example</strong>:</p><div class="examples"><pre><code>{
"meta": {
"total": 100
},
Expand Down

0 comments on commit c2d57e3

Please sign in to comment.