diff --git a/docs/server/generate_http_server_api_documentation.py b/docs/server/generate_http_server_api_documentation.py index 276c7f44..52520f47 100644 --- a/docs/server/generate_http_server_api_documentation.py +++ b/docs/server/generate_http_server_api_documentation.py @@ -58,7 +58,7 @@ Content-Type: application/json """ TPLS['post-tx-request'] = """\ -POST /api/v1/transactions/ HTTP/1.1 +POST /api/v1/transactions?mode=async HTTP/1.1 Host: example.com Content-Type: application/json diff --git a/docs/server/source/http-client-server-api.rst b/docs/server/source/http-client-server-api.rst index fce27c15..c088f926 100644 --- a/docs/server/source/http-client-server-api.rst +++ b/docs/server/source/http-client-server-api.rst @@ -124,22 +124,19 @@ Transactions :statuscode 400: The request wasn't understood by the server, e.g. the ``asset_id`` querystring was not included in the request. -.. http:post:: /api/v1/transactions +.. http:post:: /api/v1/transactions?mode={mode} - Push a new transaction. + Tendermint offers a `broadcast API + `_ with three different modes to post transactions. + By setting the mode, a new transaction can be pushed with a different mode than the default. The default mode is ``async``, which + will return immediately and not wait to see if the transaction is valid. The ``sync`` mode will return after the transactions is validated, while ``commit`` + returns after a transaction is committed to a block. .. note:: - The posted `transaction - `_ - should be structurally valid and not spending an already spent output. - The steps to build a valid transaction are beyond the scope of this page. - One would normally use a driver such as the `BigchainDB Python Driver - `_ - to build a valid transaction. - A generalization of the parameter follows: + This option is only available when using BigchainDB with Tendermint. - :param mode: (Optional) Set the broadcast method. + :query string mode: (Optional) One of the three supported modes to send a transaction: ``async``, ``sync``, ``commit``. **Example request**: @@ -165,25 +162,19 @@ Transactions :statuscode 202: The pushed transaction was accepted in the ``BACKLOG``, but the processing has not been completed. :statuscode 400: The transaction was malformed and not accepted in the ``BACKLOG``. -.. http:post:: /api/v1/transactions?mode={mode} + +.. http:post:: /api/v1/transactions + + The endpoint without any parameters will push a new transaction. If BigchainDB is used with Tendermint, the default mode ``async`` is used. .. note:: - - This option is only available when using BigchainDB with Tendermint. - - Tendermint offers a `broadcast API - `_ with three different modes to send transactions. - By setting the mode, a new transaction can be pushed with a different mode than the default. The default mode is ``broadcast_tx_async``, which - will return immediately and not wait to see if the transaction is valid. - - :query string mode: (Optional) One of the three supported modes to send a transaction: ``broadcast_tx_async``, ``broadcast_tx_sync``, ``broadcast_tx_commit``. - - The only change for a request, compared to the one above, is to set the mode - - .. sourcecode:: http - - GET /api/v1/transactions?mode={mode} HTTP/1.1 - + The posted `transaction + `_ + should be structurally valid and not spending an already spent output. + The steps to build a valid transaction are beyond the scope of this page. + One would normally use a driver such as the `BigchainDB Python Driver + `_ + to build a valid transaction. Transaction Outputs -------------------