Projet

Général

Profil

Pelle API v10 » Historique » Version 29

Nicolas BERTRAND, 13/09/2016 17:04

1 1 Nicolas BERTRAND
h1. Pelle API v10
2 2 Nicolas BERTRAND
3 22 Nicolas BERTRAND
This document describes the REST API interface to control distribution of DCPs for "Indé-CP":http://www.indecp.org .
4 22 Nicolas BERTRAND
 
5 24 Nicolas BERTRAND
The distribution is managed via the tuco:http://tuco.tdcpb.org
6 24 Nicolas BERTRAND
7 24 Nicolas BERTRAND
Basically this API provides services  
8 22 Nicolas BERTRAND
9 2 Nicolas BERTRAND
h2. API Base URL
10 3 Nicolas BERTRAND
11 23 Nicolas BERTRAND
All URLs in the reference documentation use the following base URL:
12 2 Nicolas BERTRAND
<pre>
13 2 Nicolas BERTRAND
https://tuco.tdcpb.org/pelle/v1.0
14 1 Nicolas BERTRAND
</pre>
15 23 Nicolas BERTRAND
16 2 Nicolas BERTRAND
17 2 Nicolas BERTRAND
h2. Authentication
18 2 Nicolas BERTRAND
19 2 Nicolas BERTRAND
HTTP requests to the REST API are protected with HTTP Basic authentication 
20 2 Nicolas BERTRAND
21 2 Nicolas BERTRAND
Example:
22 2 Nicolas BERTRAND
<pre>
23 2 Nicolas BERTRAND
curl -u <username>:<pass> -H "Content-Type: application/json" -X GET https://tuco.tdcpb.org/pelle/v1.0/exhibitors
24 2 Nicolas BERTRAND
</pre>
25 4 Nicolas BERTRAND
26 9 Nicolas BERTRAND
h2. Exhibitors Resources
27 4 Nicolas BERTRAND
28 6 Nicolas BERTRAND
h3. Exhibitor Properties
29 8 Nicolas BERTRAND
30 8 Nicolas BERTRAND
|_. NAME |_. DESCRIPTION |
31 7 Nicolas BERTRAND
| cncid | Unique exhibitor authorization ID given by CNC |
32 7 Nicolas BERTRAND
| id |  Unique ID given by tuco (internal usage) |
33 7 Nicolas BERTRAND
| name | Theater name |
34 7 Nicolas BERTRAND
| address |  Exhibitor address |
35 7 Nicolas BERTRAND
| city |  Exhibitor city |
36 7 Nicolas BERTRAND
| contact |  Person to contact |
37 1 Nicolas BERTRAND
38 7 Nicolas BERTRAND
 
39 6 Nicolas BERTRAND
40 5 Nicolas BERTRAND
41 4 Nicolas BERTRAND
h3. List all exhibitors
42 4 Nicolas BERTRAND
43 4 Nicolas BERTRAND
<pre>
44 4 Nicolas BERTRAND
GET exhibitors
45 4 Nicolas BERTRAND
</pre>
46 4 Nicolas BERTRAND
47 9 Nicolas BERTRAND
Output sample:
48 1 Nicolas BERTRAND
49 1 Nicolas BERTRAND
<pre>
50 1 Nicolas BERTRAND
{
51 5 Nicolas BERTRAND
  exhibitors:[
52 5 Nicolas BERTRAND
  {
53 1 Nicolas BERTRAND
    'cncid': '123456',
54 9 Nicolas BERTRAND
    'name': 'UN CINEMA'
55 1 Nicolas BERTRAND
    'city' : LA VILLE
56 9 Nicolas BERTRAND
  },
57 9 Nicolas BERTRAND
....
58 1 Nicolas BERTRAND
 ]
59 9 Nicolas BERTRAND
}
60 9 Nicolas BERTRAND
</pre>
61 9 Nicolas BERTRAND
62 9 Nicolas BERTRAND
h3. Retrieve a exhibitor
63 9 Nicolas BERTRAND
64 9 Nicolas BERTRAND
<pre>
65 9 Nicolas BERTRAND
GET exhibitors/<cncid>
66 9 Nicolas BERTRAND
</pre>
67 9 Nicolas BERTRAND
68 9 Nicolas BERTRAND
69 9 Nicolas BERTRAND
Output sample:
70 9 Nicolas BERTRAND
71 9 Nicolas BERTRAND
<pre>
72 9 Nicolas BERTRAND
{
73 9 Nicolas BERTRAND
  exhibitors:
74 9 Nicolas BERTRAND
  {
75 9 Nicolas BERTRAND
    'cncid': '123456',
76 9 Nicolas BERTRAND
    'name': 'UN CINEMA'
77 9 Nicolas BERTRAND
    'city' : LA VILLE
78 9 Nicolas BERTRAND
  },
79 4 Nicolas BERTRAND
}
80 4 Nicolas BERTRAND
</pre>
81 10 Nicolas BERTRAND
82 10 Nicolas BERTRAND
83 10 Nicolas BERTRAND
h3. Retrieve a exhibitor current downloads
84 10 Nicolas BERTRAND
85 10 Nicolas BERTRAND
86 10 Nicolas BERTRAND
<pre>
87 10 Nicolas BERTRAND
GET exhibitors/<cncid>/current_downloads
88 10 Nicolas BERTRAND
</pre>
89 10 Nicolas BERTRAND
90 10 Nicolas BERTRAND
91 10 Nicolas BERTRAND
Output sample:
92 10 Nicolas BERTRAND
<pre>
93 10 Nicolas BERTRAND
</pre>
94 11 Nicolas BERTRAND
95 11 Nicolas BERTRAND
96 11 Nicolas BERTRAND
97 11 Nicolas BERTRAND
h2. Distributor Resources
98 11 Nicolas BERTRAND
99 11 Nicolas BERTRAND
h3. Distributor Properties
100 26 Nicolas BERTRAND
101 25 Nicolas BERTRAND
|_. NAME |_. DESCRIPTION |
102 25 Nicolas BERTRAND
| cncid | Unique ID given by CNC |
103 25 Nicolas BERTRAND
| id |  Unique ID given by tuco (internal usage) |
104 28 Nicolas BERTRAND
| name | Distributor name |
105 25 Nicolas BERTRAND
106 28 Nicolas BERTRAND
107 11 Nicolas BERTRAND
h3. List all distributors
108 11 Nicolas BERTRAND
109 11 Nicolas BERTRAND
<pre>
110 11 Nicolas BERTRAND
GET distributors
111 11 Nicolas BERTRAND
</pre>
112 11 Nicolas BERTRAND
113 11 Nicolas BERTRAND
Output sample:
114 25 Nicolas BERTRAND
<pre>
115 25 Nicolas BERTRAND
{
116 25 Nicolas BERTRAND
    "distributors": [
117 27 Nicolas BERTRAND
       {
118 27 Nicolas BERTRAND
            "cncid": 1261, 
119 27 Nicolas BERTRAND
            "distributorid": 47, 
120 27 Nicolas BERTRAND
            "name": "LES FILMS DU LOSANGE"
121 25 Nicolas BERTRAND
        }, 
122 25 Nicolas BERTRAND
        {
123 27 Nicolas BERTRAND
            "cncid": 3133, 
124 27 Nicolas BERTRAND
            "distributorid": 41, 
125 27 Nicolas BERTRAND
            "name": "URBAN DISTRIBUTION"
126 27 Nicolas BERTRAND
        }, 
127 27 Nicolas BERTRAND
128 27 Nicolas BERTRAND
    ...
129 27 Nicolas BERTRAND
    ]
130 1 Nicolas BERTRAND
} 
131 1 Nicolas BERTRAND
</pre>
132 1 Nicolas BERTRAND
133 1 Nicolas BERTRAND
h3. Retrieve a distributor
134 1 Nicolas BERTRAND
135 1 Nicolas BERTRAND
<pre>
136 1 Nicolas BERTRAND
GET distributors/<cncid>
137 1 Nicolas BERTRAND
</pre>
138 25 Nicolas BERTRAND
139 27 Nicolas BERTRAND
Output sample
140 28 Nicolas BERTRAND
<pre>
141 27 Nicolas BERTRAND
{
142 27 Nicolas BERTRAND
    "distributor": {
143 27 Nicolas BERTRAND
        "cncid": 1261, 
144 27 Nicolas BERTRAND
        "distributorid": 47, 
145 27 Nicolas BERTRAND
        "name": "LES FILMS DU LOSANGE"
146 27 Nicolas BERTRAND
    }
147 27 Nicolas BERTRAND
}
148 28 Nicolas BERTRAND
</pre>
149 12 Nicolas BERTRAND
150 12 Nicolas BERTRAND
h3. List distributor catalog
151 12 Nicolas BERTRAND
<pre>
152 12 Nicolas BERTRAND
GET distributors/<cncid>/movies
153 12 Nicolas BERTRAND
</pre>
154 12 Nicolas BERTRAND
155 12 Nicolas BERTRAND
156 12 Nicolas BERTRAND
Output sample:
157 29 Nicolas BERTRAND
<pre>
158 29 Nicolas BERTRAND
{
159 29 Nicolas BERTRAND
    "movies": [ 
160 29 Nicolas BERTRAND
        {
161 29 Nicolas BERTRAND
            "dcps": [
162 29 Nicolas BERTRAND
                {
163 29 Nicolas BERTRAND
                    "contentkind": "FTR", 
164 29 Nicolas BERTRAND
                    "dcpid": 512, 
165 29 Nicolas BERTRAND
                    "name": "LeFilsDeJoseph_FTR_F_FR-FR_FR_51_2K_LOS_20160219_DGM_IOP_OV", 
166 29 Nicolas BERTRAND
                    "size": "207208283635"
167 29 Nicolas BERTRAND
                }
168 29 Nicolas BERTRAND
            ], 
169 29 Nicolas BERTRAND
            "movieid": 330, 
170 29 Nicolas BERTRAND
            "original_title": "", 
171 29 Nicolas BERTRAND
            "releasedate": "2016-04-20", 
172 29 Nicolas BERTRAND
            "title": "LE FILS DE JOSEPH"
173 29 Nicolas BERTRAND
        }, 
174 29 Nicolas BERTRAND
        {
175 29 Nicolas BERTRAND
            "dcps": [
176 29 Nicolas BERTRAND
                {
177 29 Nicolas BERTRAND
                    "contentkind": "FTR", 
178 29 Nicolas BERTRAND
                    "dcpid": 541, 
179 29 Nicolas BERTRAND
                    "name": "LAvenir_FTR_F_FR-FR_FR_51_2K_FDL_20160229_ECL_IOP_OV", 
180 29 Nicolas BERTRAND
                    "size": "186571642897"
181 29 Nicolas BERTRAND
                }, 
182 29 Nicolas BERTRAND
                {
183 29 Nicolas BERTRAND
                    "contentkind": "TLR", 
184 29 Nicolas BERTRAND
                    "dcpid": 543, 
185 29 Nicolas BERTRAND
                    "name": "LAvenir_TLR-P-Date_F_FR-XX_FR_51_2K_FDL_20160308_ECL_IOP_OV", 
186 29 Nicolas BERTRAND
                    "size": "3100055161"
187 29 Nicolas BERTRAND
                }
188 29 Nicolas BERTRAND
            ], 
189 29 Nicolas BERTRAND
            "movieid": 343, 
190 29 Nicolas BERTRAND
            "original_title": "", 
191 29 Nicolas BERTRAND
            "releasedate": "2016-04-06", 
192 29 Nicolas BERTRAND
            "title": "L'AVENIR"
193 29 Nicolas BERTRAND
        }, 
194 29 Nicolas BERTRAND
        {
195 29 Nicolas BERTRAND
            "dcps": [
196 29 Nicolas BERTRAND
                {
197 29 Nicolas BERTRAND
                    "contentkind": "TLR", 
198 29 Nicolas BERTRAND
                    "dcpid": 1049, 
199 29 Nicolas BERTRAND
                    "name": "ResterVertical_TLR_F_FR-XX_FR_51_2K_LOS_20160704_TST_IOP_OV", 
200 29 Nicolas BERTRAND
                    "size": "1438180164"
201 29 Nicolas BERTRAND
                }
202 29 Nicolas BERTRAND
            ], 
203 29 Nicolas BERTRAND
            "movieid": 430, 
204 29 Nicolas BERTRAND
            "original_title": "", 
205 29 Nicolas BERTRAND
            "releasedate": "2016-08-24", 
206 29 Nicolas BERTRAND
            "title": "RESTER VERTICAL"
207 29 Nicolas BERTRAND
        }
208 29 Nicolas BERTRAND
    ]
209 29 Nicolas BERTRAND
}
210 29 Nicolas BERTRAND
</pre>
211 29 Nicolas BERTRAND
212 12 Nicolas BERTRAND
213 13 Nicolas BERTRAND
214 13 Nicolas BERTRAND
h2. Distribution Resources
215 13 Nicolas BERTRAND
216 17 Nicolas BERTRAND
h3. properties
217 17 Nicolas BERTRAND
218 17 Nicolas BERTRAND
|_. NAME |_. DESCRIPTION |
219 17 Nicolas BERTRAND
| autorisation_date | Date of distribution autorisation |
220 17 Nicolas BERTRAND
| dcp | DCP name on distribution | 
221 17 Nicolas BERTRAND
| dcpid | Id of DCP on distribution |
222 17 Nicolas BERTRAND
| eta | Estimated Time of Accomplishment for DCP download in theater (available when _status_ is _Distribution started_ , _N/A_ else) |
223 18 Nicolas BERTRAND
| exhibitor | Exhibitor name |
224 18 Nicolas BERTRAND
| exhibitor_cncid |  Unique exhibitor authorization ID given by CNC |
225 18 Nicolas BERTRAND
| finished_transfer_date | Finished transfer to theater date |
226 18 Nicolas BERTRAND
| proress | DCP download progress in percent (available when _status_ is _Distribution started_ , _N/A_ else) |
227 18 Nicolas BERTRAND
| started_transfer_date |DCP download start date |
228 19 Nicolas BERTRAND
| status | Distribution status (cf. next table)|
229 17 Nicolas BERTRAND
230 17 Nicolas BERTRAND
231 19 Nicolas BERTRAND
*Distribution status states:*
232 1 Nicolas BERTRAND
233 1 Nicolas BERTRAND
|_. NAME |
234 19 Nicolas BERTRAND
| 'Distribution not allowed' |
235 19 Nicolas BERTRAND
| 'Distribution allowed' |
236 19 Nicolas BERTRAND
| 'Distribution started' |
237 19 Nicolas BERTRAND
| 'Distribution finished' |
238 19 Nicolas BERTRAND
| 'Distribution error' |
239 19 Nicolas BERTRAND
 
240 19 Nicolas BERTRAND
241 17 Nicolas BERTRAND
242 17 Nicolas BERTRAND
243 14 Nicolas BERTRAND
h3. Retrieve distribution status of DCP <dcpid> to exhibitor <cncid>
244 14 Nicolas BERTRAND
245 14 Nicolas BERTRAND
<pre>
246 14 Nicolas BERTRAND
GET distributions/<cncid>/<dcpid>
247 14 Nicolas BERTRAND
</pre>
248 14 Nicolas BERTRAND
249 16 Nicolas BERTRAND
Sample output
250 16 Nicolas BERTRAND
<pre>
251 16 Nicolas BERTRAND
{
252 16 Nicolas BERTRAND
    "distributions": {
253 16 Nicolas BERTRAND
        "autorisation_date": "2016-07-04T07:25:16", 
254 16 Nicolas BERTRAND
        "dcp": "HAUT-ET-COURT_TONI-ERDMANN_2K-F-185_51-DE_ST-FR_DCP-24-IOP-CPT_1606TVS7354", 
255 16 Nicolas BERTRAND
        "dcpid": 1024, 
256 16 Nicolas BERTRAND
        "eta": "N/A", 
257 16 Nicolas BERTRAND
        "exhibitor": "UTOPIA TOURNEFEUILLE", 
258 16 Nicolas BERTRAND
        "exhibitor_cncid": 431352, 
259 16 Nicolas BERTRAND
        "finished_transfer_date": "2016-07-08T11:30:55", 
260 16 Nicolas BERTRAND
        "progress": "N/A", 
261 16 Nicolas BERTRAND
        "started_transfer_date": "2016-07-04T13:29:07", 
262 16 Nicolas BERTRAND
        "status": "Distribution finished", 
263 16 Nicolas BERTRAND
        "statusId": 0
264 16 Nicolas BERTRAND
    }
265 16 Nicolas BERTRAND
}
266 16 Nicolas BERTRAND
</pre>
267 13 Nicolas BERTRAND
268 12 Nicolas BERTRAND
h3. Distribute a DCP to a distributor
269 12 Nicolas BERTRAND
270 12 Nicolas BERTRAND
<pre>
271 15 Nicolas BERTRAND
POST distributions
272 1 Nicolas BERTRAND
</pre>
273 15 Nicolas BERTRAND
274 15 Nicolas BERTRAND
Parameters
275 15 Nicolas BERTRAND
276 15 Nicolas BERTRAND
|_. NAME |_. DESCRIPTION |
277 15 Nicolas BERTRAND
| cncid | Unique exhibitor authorization ID given by CNC |
278 15 Nicolas BERTRAND
| dcpid | Id of DCP to distribute |
279 16 Nicolas BERTRAND
280 16 Nicolas BERTRAND
*Sample*
281 16 Nicolas BERTRAND
Distribute Toni Erdman FTR DCP (dcpid: 1024) to Utopia tournefeuille( cncid: 431352 )
282 21 Nicolas BERTRAND
_Input:_
283 16 Nicolas BERTRAND
<pre>
284 16 Nicolas BERTRAND
curl -H "Content-Type: application/json" \ 
285 16 Nicolas BERTRAND
-u username:password \
286 16 Nicolas BERTRAND
-X POST\
287 16 Nicolas BERTRAND
-d '{"cncid": "431352", "dcpid": "1024" }'\
288 16 Nicolas BERTRAND
-i https://tuco.tdcpb.org/pelle/v1.0/distributions
289 16 Nicolas BERTRAND
</pre>
290 21 Nicolas BERTRAND
_Output:_
291 20 Nicolas BERTRAND
<pre>
292 20 Nicolas BERTRAND
{
293 20 Nicolas BERTRAND
code 201 CREATED
294 20 Nicolas BERTRAND
{
295 20 Nicolas BERTRAND
    "distributions": {
296 20 Nicolas BERTRAND
        "autorisation_date": "2016-07-04T07:25:16", 
297 20 Nicolas BERTRAND
        "dcp": "HAUT-ET-COURT_TONI-ERDMANN_2K-F-185_51-DE_ST-FR_DCP-24-IOP-CPT_1606TVS7354", 
298 20 Nicolas BERTRAND
        "dcpid": 1024, 
299 20 Nicolas BERTRAND
        "eta": "N/A", 
300 20 Nicolas BERTRAND
        "exhibitor": "UTOPIA TOURNEFEUILLE", 
301 20 Nicolas BERTRAND
        "exhibitor_cncid": 431352, 
302 20 Nicolas BERTRAND
        "finished_transfer_date": "2016-07-08T11:30:55", 
303 20 Nicolas BERTRAND
        "progress": "N/A", 
304 20 Nicolas BERTRAND
        "started_transfer_date": "2016-07-04T13:29:07", 
305 20 Nicolas BERTRAND
        "status": "Distribution finished", 
306 20 Nicolas BERTRAND
    }
307 20 Nicolas BERTRAND
}
308 20 Nicolas BERTRAND
</pre>
309 20 Nicolas BERTRAND
310 20 Nicolas BERTRAND
h3. Delete a distribution instance
311 20 Nicolas BERTRAND
312 20 Nicolas BERTRAND
<pre>
313 20 Nicolas BERTRAND
DELETE distributions/<cncid>/<dcpid>
314 20 Nicolas BERTRAND
</pre>
315 20 Nicolas BERTRAND
316 20 Nicolas BERTRAND
*Sample*
317 20 Nicolas BERTRAND
Distribute Toni Erdman FTR DCP (dcpid: 1024) to Utopia tournefeuille( cncid: 431352 )
318 20 Nicolas BERTRAND
_Input_
319 20 Nicolas BERTRAND
<pre>
320 20 Nicolas BERTRAND
curl \ 
321 20 Nicolas BERTRAND
-u username:password \
322 20 Nicolas BERTRAND
-X DELETE\
323 20 Nicolas BERTRAND
-d '{"cncid": "431352", "dcpid": "1024" }'\
324 20 Nicolas BERTRAND
-i https://tuco.tdcpb.org/pelle/v1.0/distributions
325 20 Nicolas BERTRAND
</pre>
326 20 Nicolas BERTRAND
327 20 Nicolas BERTRAND
_Output_
328 20 Nicolas BERTRAND
<pre>
329 20 Nicolas BERTRAND
No output
330 20 Nicolas BERTRAND
code 204 NO CONTENT
331 20 Nicolas BERTRAND
</pre>