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
**Note:** If you set the `ZENCODER_API_KEY` environment variable to your api key, you don't have to provide it when initializing Zencoder.
16
+
```python
17
+
from zencoder import Zencoder
18
+
```
47
19
48
-
## Specifying the API Version
49
-
Set the version of the Zencoder API you want to use as the `api_version` keyword to the `Zencoder` object (defaults to `v2`):
20
+
Create an instance of the Zencoder client. This will accept an API key and version. If not API key is set, it will look for a `ZENCODER_API_KEY` environment variable. API version defaults to 'v2'.
50
21
51
-
```python
52
-
# set to version 1: https://app.zencoder.com/api/v1/
53
-
zen = Zencoder(api_version='v1')
22
+
# If you want to specify an API key when creating a client
23
+
client = Zencoder('API_KEY')
54
24
55
-
# set to the edge version: https://app.zencoder.com/api/
56
-
zen = Zencoder(api_version='edge')
57
-
```
25
+
# If you have the environment variable set
26
+
client = Zencoder()
58
27
59
-
## Jobs
28
+
## [Jobs](https://app.zencoder.com/docs/api/jobs)
60
29
61
30
There's more you can do on jobs than anything else in the API. The following methods are available: `list`, `create`, `details`, `progress`, `resubmit`, `cancel`, `delete`.
62
31
63
-
### create
32
+
Create a [new job](https://app.zencoder.com/docs/api/jobs/create).
By default the jobs listing is paginated with 50 jobs per page and sorted by ID in descending order. You can pass two parameters to control the paging: `page` and `per_page`.
83
52
@@ -86,31 +55,31 @@ zen.job.list(per_page=10)
86
55
zen.job.list(per_page=10, page=2)
87
56
```
88
57
89
-
### details
58
+
Get [details](https://app.zencoder.com/docs/api/jobs/show) about a job.
90
59
91
60
The number passed to `details` is the ID of a Zencoder job.
92
61
93
62
```python
94
63
zen.job.details(1)
95
64
```
96
65
97
-
### progress
66
+
Get [progress](https://app.zencoder.com/docs/api/jobs/progress) on a job.
98
67
99
68
The number passed to `progress` is the ID of a Zencoder job.
100
69
101
70
```python
102
71
zen.job.progress(1)
103
72
```
104
73
105
-
### resubmit
74
+
[Resubmit](https://app.zencoder.com/docs/api/jobs/resubmit) a job
106
75
107
76
The number passed to `resubmit` is the ID of a Zencoder job.
108
77
109
78
```python
110
79
zen.job.resubmit(1)
111
80
```
112
81
113
-
### cancel
82
+
[Cancel](https://app.zencoder.com/docs/api/jobs/cancel) a job
114
83
115
84
The number passed to `cancel` is the ID of a Zencoder job.
116
85
@@ -126,97 +95,60 @@ The number passed to `delete` is the ID of a Zencoder job.
Reports are great for getting usage data for your account. All default to 30 days from yesterday with no [grouping](https://app.zencoder.com/docs/api/encoding/job/grouping), but this can be altered. These will return `422 Unprocessable Entity` if the date format is incorrect or the range is greater than 2 months.
168
137
169
-
No API Key is required.
170
-
171
-
```python
172
-
zen.account.create('foo@example.com', tos=1)
173
-
zen.account.create('foo@example.com', tos=1,
174
-
options={'password': 'abcd1234',
175
-
'affiliate_code': 'foo'})
176
-
```
177
-
178
-
### details
179
-
180
-
```python
181
-
zen.account.details()
182
-
```
183
-
184
-
### integration
185
-
186
-
This will put your account into integration mode (site-wide).
187
-
188
-
```python
189
-
zen.account.integration()
190
-
```
191
-
192
-
### live
193
-
194
-
This will put your account into live mode (site-wide).
195
-
196
-
```python
197
-
zen.account.live()
198
-
```
199
-
200
-
## Reports
201
-
202
-
### minutes
203
-
204
-
This will list the minutes used for your account within a certain, configurable range.
138
+
Get [all usage](https://app.zencoder.com/docs/api/reports/all) (Live + VOD).
This will list all of the transcoding minutes used for your account.
179
+
Create a [new account](https://app.zencoder.com/docs/api/accounts/create). A unique email address and terms of service are required, but you can also specify a password (and confirmation) along with whether or not you want to subscribe to the Zencoder newsletter. New accounts will be created under the Test (Free) plan.
0 commit comments