You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
res = cloudconvert.Task.wait(id=exported_url_task_id) # Wait for job completion
65
+
res = cloudconvert.Task.wait(id=exported_url_task_id) # Wait for job completion
66
66
file= res.get("result").get("files")[0]
67
67
res = cloudconvert.download(filename=file['filename'], url=file['url'])
68
68
print(res)
69
69
```
70
70
71
71
## Uploading Files
72
72
73
-
Uploads to CloudConvert are done via `import/upload` tasks (see the [docs](https://cloudconvert.com/api/v2/import#import-upload-tasks)). This SDK offers a convenient upload method:
73
+
Uploads to CloudConvert are done via `import/upload` tasks (see
74
+
the [docs](https://cloudconvert.com/api/v2/import#import-upload-tasks)). This SDK offers a convenient upload method:
74
75
75
76
```py
76
77
job = cloudconvert.Job.create(payload={
@@ -88,16 +89,44 @@ res = cloudconvert.Task.upload(file_name='path/to/sample.pdf', task=upload_task)
88
89
89
90
res = cloudconvert.Task.find(id=upload_task_id)
90
91
```
92
+
91
93
## Webhook Signing
92
94
93
95
The node SDK allows to verify webhook requests received from CloudConvert.
94
96
95
97
```py
96
-
payloadString ='...'; # The JSON string from the raw request body.
97
-
signature ='...'; # The value of the "CloudConvert-Signature" header.
98
-
signingSecret ='...'; # You can find it in your webhook settings.
98
+
payloadString ='...'; # The JSON string from the raw request body.
99
+
signature ='...'; # The value of the "CloudConvert-Signature" header.
100
+
signingSecret ='...'; # You can find it in your webhook settings.
101
+
102
+
isValid = cloudconvert.Webhook.verify(payloadString, signature, signingSecret); # returns true or false
103
+
```
104
+
105
+
## Signed URLs
106
+
107
+
Signed URLs allow converting files on demand only using URL query parameters. The Python SDK allows to generate such
108
+
URLs. Therefore, you need to obtain a signed URL base and a signing secret on
109
+
the [CloudConvert Dashboard](https://cloudconvert.com/dashboard/api/v2/signed-urls).
110
+
111
+
```py
112
+
base ='https://s.cloudconvert.com/...'# You can find it in your signed URL settings.
113
+
signing_secret ='...'# You can find it in your signed URL settings.
114
+
cache_key ='cache-key'# Allows caching of the result file for 24h
0 commit comments