Skip to content
This repository was archived by the owner on Feb 17, 2026. It is now read-only.

Commit 2813eb5

Browse files
committed
Merge branch 'master' of github.com:OriginStampTimestamping/originstamp-client-python
2 parents e792773 + 0164d99 commit 2813eb5

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

docs/TimestampApi.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ Name | Type | Description | Notes
153153
154154
Proof
155155

156+
Attention! For the different request types (XML and PDF), there have to be passed different options. See the example for more details.
157+
156158
This request can be used to proof a submission of a hash. This interface is required to request the evidence. With the help of this proof the verification of a timestamp independent from OriginStamp is necessary. A guide for the verification can be found herehttps://github.com/OriginStampTimestamping/originstamp-verification . Usually, the proof should be requested for each transferred hash and kept with the timestamped data so that an independent verification of the timestamp is possible at any time. As input, the used currency, the hash string and the type of proof is required. Then a file with the information for the submission proof will be returned. If the hash was submitted in an API version lower than 3, a XML file containing the essential information of the Merkle Tree will be returned. Otherwise, the seed file will be returned. The file name can be found in the header of the response. An example could look like this: content-disposition: attachment; filename=\"certificate_6d70a947e19398f1106ad70a60bd34a8305bdcb624b5b7d43782315517e79cad.pdf\" A sample XML file can be found here https://originstamp.org/assets/proof/proof_6d70a947e19398f1106ad70a60bd34a8305bdcb624b5b7d43782315517e79cad.xml and a sample PDF can be found here https://originstamp.org/assets/proof/certificate_6d70a947e19398f1106ad70a60bd34a8305bdcb624b5b7d43782315517e79cad.pdf .
157159

158160
### Example
@@ -166,12 +168,29 @@ from pprint import pprint
166168
# create an instance of the API class
167169
api_instance = originstamp_client.TimestampApi()
168170
authorization = 'authorization_example' # str | A valid API key is essential for authorization to handle the request.
169-
proof_request = originstamp_client.ProofRequest() # ProofRequest | Information needed to return the hash status information.
171+
proof_request = originstamp_client.ProofRequest(0, hash, 0) # ProofRequest for XML | Information needed to return the hash status information.
172+
proof_request2 = originstamp_client.ProofRequest(0, hash, 1) # ProofRequest for PDF | Information needed to return the hash status information.
170173

171174
try:
172175
# Proof
173-
api_response = api_instance.get_proof(authorization, proof_request)
174-
pprint(api_response)
176+
# argument dictionary for request
177+
kwargs = {}
178+
179+
# set to true for XML requests
180+
kwargs['_preload_content'] = True
181+
# pass in the arguments
182+
pprint(api_instance.get_proof_with_http_info(authorization, proof_request, **kwargs))
183+
184+
# set to false for PDF requests
185+
kwargs['_preload_content'] = False
186+
187+
# get the binary data
188+
data = api_instance.get_proof(authorization, proof_request2, **kwargs).data
189+
190+
# write binary data to file
191+
f = open("test.pdf", "w+b")
192+
f.write(bytearray(data))
193+
f.close()
175194
except ApiException as e:
176195
print("Exception when calling TimestampApi->get_proof: %s\n" % e)
177196
```

0 commit comments

Comments
 (0)