785 Commits

Author SHA1 Message Date
diminator
6aca7e2605 list assets recipe and sample 2017-01-25 10:42:32 +01:00
diminator
14f22cb8af status with block and transaction context 2017-01-25 10:42:32 +01:00
diminator
b252c40793 GET /votes examples -> samples 2017-01-25 10:42:32 +01:00
diminator
be5bc9fafd GET blocks?txid examples -> samples 2017-01-25 10:42:32 +01:00
diminator
e79a76512f remove rudimentary note and typo's 2017-01-25 10:42:32 +01:00
diminator
e54d50a58f Add docs links to root endpoints 2017-01-25 10:41:51 +01:00
diminator
21ffe22516 API root URL vs BigchainDB root URL 2017-01-25 10:39:21 +01:00
diminator
204c8cce9c GET blocks/id examples -> samples 2017-01-25 10:38:33 +01:00
diminator
5c10602754 examples -> samples POST /transaction and /statuses 2017-01-25 10:38:33 +01:00
diminator
35a7d11fb3 remove metadata query from endpoint -> see #856 2017-01-25 10:36:20 +01:00
diminator
b947cf7c72 GET transactions?operation&asset_id examples --> samples
Updated example to include more than one TRANSFER
2017-01-25 10:36:20 +01:00
diminator
a37b505c87 (fix): forgot one owners_after -> public_keys 2017-01-25 10:36:20 +01:00
diminator
d09a93f1a7 update GET transactions?unfulfilled
- owners_after -> public_keys
- examples -> samples
2017-01-25 10:36:20 +01:00
diminator
a8f8c7f4a9 GET transactions/id examples --> samples 2017-01-25 10:36:20 +01:00
diminator
56b4da02c9 (fix) : minor fixes to server docs for building 2017-01-25 10:36:20 +01:00
tim
6e25ef4598 Add retrieve votes by block 2017-01-25 10:36:20 +01:00
tim
df3ded315c Remove retrieve vote by vote_id
After talking to @r-marques and @libscott:

    - A vote's id is currently generated by RethinkDB
    - To verify a vote, the signature and the pubkey should be used
    - Vote's id will be removed from the "external" vote model in the
    future
    - Nobody would want to retrieve a vote, but rather a vote by block

In case of the HTTP API, this means that a /votes/vote_id endpoint is
not feasible to implement.
2017-01-25 10:36:20 +01:00
tim
0c651f6b11 Timestamp of block as header: /transactions/tx_id
For reasoning, see:
https://github.com/bigchaindb/bigchaindb/pull/830#issuecomment-262774345
2017-01-25 10:36:20 +01:00
tim
8e91e14e86 Add /blocks/{block_id} safety querystring
It didn't feel good letting users retrieve also invalid or undecided
blocks in the /blocks/{block_id} endpoint.

Hence, now a block can be evaluated by it's status.
If block_id and status do not match, a 404 Not Found HTTP status code is
returned.
Per default, status is set to valid only.
2017-01-25 10:36:20 +01:00
tim
8f7816d325 Bigchaindb --> BigchainDB 2017-01-25 10:36:20 +01:00
tim
91a1151255 Add endpoint to get blocks by transaction 2017-01-25 10:33:37 +01:00
tim
5048846b0f Minor corrections on /statuses 2017-01-25 10:33:37 +01:00
tim
5ac7eb9b5a Add notes about endpoint specialities
For details, see the following comment:
https://github.com/bigchaindb/bigchaindb/pull/830#issuecomment-262468005
2017-01-25 10:33:37 +01:00
tim
9cd4c18fb4 Remove uuid based endpoints 2017-01-25 10:33:37 +01:00
tim
ea16a8731e Remove ?fields query string 2017-01-25 10:33:37 +01:00
tim
26cb00ab9c Document /block/block_id endpoint 2017-01-25 10:33:37 +01:00
tim
af6b799c4f Adjustments according to feedback
- owner_afters --> owners_after
- List choices for operation query string
- List choices for fields query string
- Use proper sphinx-way to define type of query string
2017-01-25 10:33:37 +01:00
tim
2997a5e994 Minor corrections to endpoints 2017-01-25 10:33:37 +01:00
tim
d748a1dc18 Minor corrections of redundant infos 2017-01-25 10:33:37 +01:00
tim
9a1b1364ea Add response headers 2017-01-25 10:33:37 +01:00
tim
152f151f23 :param _: --> :query _: 2017-01-25 10:33:07 +01:00
tim
eda8cdbba1 Add docs about /transactions endpoint 2017-01-25 10:33:07 +01:00
tim
f18f3cb8d2 Add sections to be done 2017-01-25 10:33:07 +01:00
tim
0a06547c1b Add transactions by metadata id endpoint 2017-01-25 10:33:07 +01:00
tim
ee904d78f4 Add transactions by asset id endpoint 2017-01-25 10:32:17 +01:00
tim
748e155378 Get block status using /statuses 2017-01-25 10:32:17 +01:00
tim
58d0b771cb id --> resource_id
Inevitably, some resources will not allow to filter by the exact
    keyword that is included in a resources body.

    Take for example asset and metadata.
    They both have a property called 'id', hence requests of a form:

        /transactions&fields=x,y&property_name=z

    might now be allowed to be resolved as the keyword 'id' in this
    case could reference both 'metadata.id' and 'asset.id'.

    This problem cannot be structurally resolved with URL paths.
    Hence it was decided to emphasize on a few resources that
    implement 'id' as a sort-of primary key.
2017-01-25 10:32:17 +01:00
tim
90aff0e202 Give up /conditions endpoint
A transaction contains:

        - conditions
        - fulfillments
        - assets
        - meta data

    While:

        - assets; and
        - meta data

    could be viewed as their own "tables" or resources, conditions
    and fulfillments cannot. Why?

    Because in comparison they do not contain a primary key, allowing
    them to be queried by it.
2017-01-25 10:32:17 +01:00
tim
156bf4fb21 txid --> id
KISS: A transaction is a resource as every other. Let's not give it
a special id (like 'txid'), but simply a regular id.
2017-01-25 10:32:17 +01:00
tim
9766332b8b Restructure doc: Endpoints as roots 2017-01-25 10:32:17 +01:00
tim
85d9553a1e owner_after --> owners_after
Querystring keywords should be in line with data model.
2017-01-25 10:31:25 +01:00
tim
e243a1be9b Use sphinx note for note in document 2017-01-25 10:31:25 +01:00
tim
0dc9b46ea7 Structural changes to the document
- Remove /unspents/ and replace with endpoint under /transactions
- Remove /transactions/txid/conditions/cid endpoint
2017-01-25 10:30:58 +01:00
tim
b488997353 tx_id --> txid 2017-01-25 10:29:12 +01:00
tim
5789a37664 Allow /statuses to return a 303 See Other response.
According to: https://www.ietf.org/rfc/rfc2616.txt a 303 See Other can
be returned to indicate that the resource the user is looking for can be
found under a new path.
In the case of a transaction including the `status == 'valid'`, we
return 303 See Other, as well as a Location header to the /transactions
endpoint.

"The response to the request can be found under a different URI and SHOULD be
retrieved using a GET method on that resource."
2017-01-25 10:29:12 +01:00
tim
71d3c70fda Status --> Statuses
Usage of singular resource names is discouraged in REST:
http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api

The plural of status is statuses:
http://english.stackexchange.com/questions/877/what-is-the-plural-form-of-status
2017-01-25 10:28:28 +01:00
tim
1086c3a5c4 POST /transactions status code to 202
According to https://www.ietf.org/rfc/rfc2616.txt a 201 Created status
code MUST only be returned when:

"The origin server MUST create the resource before returning the 201 status
code."

hence, a 202 Accepted's definition is more appropriate:

"The request has been accepted for processing, but the processing has not been
completed.

The entity returned with this response SHOULD include an indication of the
request's current status and either a pointer to a status monitor or some
estimate of when the user can expect the request to be fulfilled."
2017-01-25 10:27:52 +01:00
tim
f15a7f7e8b Document conditions endpoint 2017-01-25 10:23:14 +01:00
libscott
a7a163fd3c Merge pull request #1083 from bigchaindb/single-quotes
Add flake8-quotes checker and cleanup double quotes
2017-01-24 12:07:29 +01:00
Scott Sadler
bd048a3115 add flake8-quotes checker and cleanup double quotes 2017-01-23 17:30:37 +01:00