Last active
November 15, 2023 19:27
-
-
Save Razikus/445bd0545db9a16b4c92ee43d6abf0f4 to your computer and use it in GitHub Desktop.
Immudb Vault Simple Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
API_KEY = "YOUR API KEY" | |
resp = requests.put("https://vault.immudb.io/ics/api/v1/ledger/default/collection/default/document", headers = { | |
"X-API-KEY": API_KEY, | |
"content-type": "application/json" | |
}, json = { | |
"reddit": "Welcome!" | |
}) | |
documentID = resp.json()["documentId"] | |
resp = requests.post("https://vault.immudb.io/ics/api/v1/ledger/default/collection/default/documents/search", headers = { | |
"X-API-KEY": API_KEY, | |
"content-type": "application/json" | |
}, json = { | |
"query": { | |
"expressions": [ | |
{ | |
"fieldComparisons": [ | |
{ | |
"field": "_id", | |
"operator": "EQ", | |
"value": documentID | |
} | |
] | |
} | |
], | |
}, | |
"page": 1, | |
"perPage": 10 | |
}) | |
print(resp.json()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment