summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-12-09 11:20:28 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-12-09 11:20:28 +0100
commit3fba4892a5f4bdd032e86eabf13ce6ac04f1e649 (patch)
tree4dc303c102b7e27380dd9b8163ba34c882e5b4ce
parent7fc415115024466ecf08b5b4ca5fc9472ad0ea2b (diff)
downloaddocs-3fba4892a5f4bdd032e86eabf13ce6ac04f1e649.tar.gz
docs-3fba4892a5f4bdd032e86eabf13ce6ac04f1e649.tar.bz2
docs-3fba4892a5f4bdd032e86eabf13ce6ac04f1e649.zip
Changin URIs to /map/in /map/out
-rw-r--r--api-merchant.rst25
1 files changed, 23 insertions, 2 deletions
diff --git a/api-merchant.rst b/api-merchant.rst
index bfa8bf1..96cbc14 100644
--- a/api-merchant.rst
+++ b/api-merchant.rst
@@ -380,7 +380,7 @@ The following API are made available by the merchant's `backend` to the merchant
}
-.. http:post:: /map
+.. http:post:: /map/in
Store a pair formed by a plain contract and its hashcode into the database.
@@ -393,6 +393,9 @@ The following API are made available by the merchant's `backend` to the merchant
:status 200 OK:
The data has been successfully stored.
+ :status 422 Unprocessable Entity:
+ The hashcode provided by the frontend does not match the contract.
+
.. _MapRequest:
.. _tsref-type-MapRequest:
.. code-block:: tsref
@@ -402,10 +405,28 @@ The following API are made available by the merchant's `backend` to the merchant
// Plain contract to be stored
contract: Contract;
- // contract's hashcode
+ // contract's hashcode. We require this value from the frontend
+ // as an additional check on data integrity.
h_contract: HashCode;
}
+
+.. http:get:: /map/out
+
+ Retrieve a contract, given its hashcode.
+
+ **Request**
+
+ :query h_contract: hashcode of the contract to retrieve.
+
+ **Response**
+
+ :status 200 OK:
+ The body contains a `contract`_ corresponding to `h_contract`.
+
+ :status 404 Not Found:
+ There is no contract corresponding to `h_contract` into the database.
+
.. http:get:: /history
Returns transactions up to some point in the past