-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathfolder_example.py
More file actions
43 lines (33 loc) · 1.21 KB
/
folder_example.py
File metadata and controls
43 lines (33 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
Example demonstrating folder functionality.
"""
from signnow.api.folder.request.folder_documents_get_request import (
FolderDocumentsGetRequest,
)
from signnow.api.folder.response.folder_documents_get_response import (
FolderDocumentsGetResponse,
)
from signnow.core.api_client import ApiClient
from signnow.core.exception import SignNowApiException
from signnow.core.factory import SdkFactory
def main():
"""
Example of getting folder documents.
"""
# Set your actual input data here
# Note: following values are dummy, just for example
# ----------------------------------------------------
from preset_data import PRESET_BEARER_TOKEN, PRESET_FOLDER_ID
bearer_token = PRESET_BEARER_TOKEN
folder_id = PRESET_FOLDER_ID
try:
client: ApiClient = SdkFactory.create_api_client_with_bearer_token(bearer_token)
request = FolderDocumentsGetRequest()
request.with_folder_id(folder_id)
response: FolderDocumentsGetResponse = client.send(request).get_response()
print(f"Folder ID: {response.id}")
print(f"Folder Name: {response.name}")
except SignNowApiException as e:
print(f"ERROR: {e}")
if __name__ == "__main__":
main()