-
Notifications
You must be signed in to change notification settings - Fork 2
/
docs.html
420 lines (365 loc) · 16.7 KB
/
docs.html
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="utf-8">
<title>Documentação - Eventick Rest API V1</title>
<meta name="description" content=" ">
<!-- styles -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="assets/css/main.css" rel="stylesheet">
<link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<link href="http://desenvolvedor.eventick.com.br/integracao" rel="canonical">
</head>
<body data-spy="scroll" data-target=".sidebar" data-offset-top="60">
<div class="navbar navbar-inverse navbar-fixed-top" >
<div class="navbar-inner">
<button type="button"class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="container">
<a class="brand" href="./"><span>Eventick</span> Developers</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active">
<a href="./">Overview</a>
</li>
<li>
<a href="./docs">Documentação</a>
</li>
<li>
<a href="./integracao">Integração com Websites</a>
</li>
</ul>
</div><!-- /.collapse -->
</div>
</div>
</div><!-- /.navbar -->
<div class="wrap">
<div class="container">
<div class="row">
<div class="span3 sidebar">
<ul class="nav nav-list" >
<li class="nav-header">Documentação</li>
<li><a href="#introducao">Introdução</a></li>
<li><a href="#erros">Erros</a></li>
<li><a href="#libaries">Bibliotecas</a></li>
<li class="nav-header">Autenticação</li>
<li><a href="#autenticao">Recebendo o token</a></li>
<li class="nav-header">Eventos</li>
<li><a href="#eventos-all">Listando eventos</a></li>
<li><a href="#evento">Informação de um evento</a></li>
<li class="nav-header">Participantes</li>
<li><a href="#lista_part">Listagem</a></li>
<li><a href="#participante">Informação de um participante</a></li>
<li><a href="#check">Checkin de um participante</a></li>
<li><a href="#check-all">Checkin de vários participantes</a></li>
</ul>
</div>
<div class="span9">
<div class="row">
<section id="introducao">
<div class="page-header">
<h1>Introdução</h1>
</div>
<p>
O Eventick foi criado por desenvolvedores. Sabemos da importância de uma API para
que aplicativos possam se integrar com a nossa plataforma. Seguimos as orientaçoes de Design <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer" target="_blank">RESTful</a> e <a href="http://jsonapi.org/" target="_blank">JSON API</a>.
</p>
<p>A API está disponivel somente via HTTPS. A URL base é <code>https://www.eventick.com.br/api/v1</code>. Todos os dados devem ser recebidos e enviados em JSON. Os campos de data e tempo estarão no formato ISO 8601: <code>YYYY-MM-DDTHH:MM:SS±hh:mm</code></p>
<section id="erros">
<h2>Erros</h2>
<p>Utilizamos os <i>status code</i> do protocolo HTTP, disponíveis no header de cada <i>response</i>.</p>
<dl class="dl-horizontal">
<dt>200 OK</dt> <dd>Tudo funcionou como esperado</dd>
<dt>400 Bad Request</dt><dd>Geralmente, um problema com os parâmetros.</dd>
<dt>401 Unauthorized</dt><dd>Tentativa de acesso com token inválido.</dd>
<dt>404 Not Found</dt><dd>O recurso acessado não existe.</dd>
<dt>50X Server errors</dt><dd>Falha nossa, algum erro no servidor.</dd>
</dl>
</section>
<section id="libaries">
<h2>Bibliotecas</h2>
<p>Para agilizar seu desenvolvimento, alguns desenvolvedores criaram bibliotecas para nossa API e plugins. Caso você tenha criado uma e deseja incluir na lista, é só <a href="mailto:[email protected]">nos avisar</a>.</p>
<ul>
<li><a href="https://github.com/lukelex/eventick_api">Ruby</a></li>
<li><a href="https://github.com/rodrigoalvesvieira/eventick-api">Java</a></li>
<li><a href="https://github.com/djalmaaraujo/eventickapi_php">PHP</a></li>
<li><a href="https://github.com/castroalves/wp-eventick">Plugin WordPress</a></li>
<li><a href="https://github.com/jugoncalves/eventick.js">JavaScript</a></li>
<li><a href="https://github.com/jeffersonmourak/node-eventick">Node.js</a></li>
<li><a href="https://github.com/hudsonbrendon/pyeventick">Python</a></li>
</ul>
</section>
</section>
<section id="autenticao">
<div class="page-header">
<h1>Autenticação</h1>
</div>
<h2>Requisitando token</h2>
<p>Ao executar uma autenticação você receberá um token para as demais requisições. A autenticação é via <a href="http://en.wikipedia.org/wiki/Basic_access_authentication" target="_blank">HTTP Basic Auth.</a></p>
<p>Autenticação via token é ideal para scripts próprios, mas não é recomendado para software de terceiros.</p>
<h3>Resource URL</h3>
<pre><code>GET https://www.eventick.com.br/api/v1/tokens.json</code></pre>
<h3>Parâmetros</h3>
<dl class="dl-horizontal">
<dt>email</dt><dd><span>Obrigatório.</span><p>Você deve informar o email que você utiliza para acessar sua conta no Eventick.</p></dd>
<dt>password</dt><dd><span>Obrigatório.</span><p>Senha utlizada para acessa sua conta no Eventick.</p></dd>
</dl>
<h3>Exemplo de Requisição</h3>
<pre><code>$ curl https://www.eventick.com.br/api/v1/tokens.json \
--user '[email protected]:password'</code></pre>
<h3>Exemplo de Resposta</h3>
<pre class="prettyprint language-javascript linenums">
{
"token":"dpoi2154wijdsk4fo65ow4o2pkd"
}</pre>
</section>
<section id="eventos">
<section id="eventos-all">
<div class="page-header">
<h1>Eventos</h1>
</div>
<p>Permite acessar as informações dos eventos de um usuário.</p>
<h2>Listando eventos</h2>
<h3>Resource URL</h3>
<pre><code>GET https://www.eventick.com.br/api/v1/events.json</code></pre>
<h3>Parâmetros</h3>
<dl class="dl-horizontal">
<dt>auth_token</dt>
<dd><span>Obrigatório.</span><p>Token necessário para identificação do usuário.</p></dd>
</dl>
<h3>Exemplo de Requisição</h3>
<pre><code>$ curl https://www.eventick.com.br/api/v1/events.json \
-u 'YUxHFjkB1x3QHB5ak5qr:'</code></pre>
<h3>Exemplo de Resposta</h3>
<pre class="prettyprint language-javascript linenums">
{
"events":[
{
"id": 11,
"start_at": "2012-10-17T16:00:00-03:00",
"title": "teste",
"theme_color": "ffb300",
"thumbnail_url": "https://s3-sa-east-1.amazonaws.com/eventick-events-images/0a7a9a3c-46ef-4fa9-b290-a716f756ebc9/download.crop_275x82_0,51.scale_crop_357x107.jpeg"
}
]
}
</pre>
</section>
<section id="evento">
<h2>Informação de um evento</h2>
<h3>Resource URL</h3>
<pre><code>GET https://www.eventick.com.br/api/v1/events/:id.json</code></pre>
<h3>Parâmetros</h3>
<dl class="dl-horizontal">
<dt>auth_token</dt>
<dd><span>Obrigatório.</span><p>Token necessário para identificação do usuário.</p></dd>
<dt>id</dt>
<dd><span>Obrigatório.</span><p>O identificador do evento.</p></dd>
</dl>
<h3>Exemplo de Requisição</h3>
<pre><code>$ curl https://www.eventick.com.br/api/v1/events/1706.json \
-u 'YUxHFjkB1x3QHB5ak5qr:'</code></pre>
<h3>Exemplo de Resposta</h3>
<pre class="prettyprint language-javascript linenums">
{
"events":[
{
"id": 11,
"start_at": "2012-10-17T16:00:00-03:00",
"title":"Abril pro Ruby'13",
"venue":"Faculdade Marista",
"slug":"abrilproruby",
"theme_color": "ffb300",
"thumbnail_url": "https://s3-sa-east-1.amazonaws.com/eventick-events-images/0a7a9a3c-46ef-4fa9-b290-a716f756ebc9/download.crop_275x82_0,51.scale_crop_357x107.jpeg",
"links":{
"tickets":[
{
"id":4464,
"name":"Segundo lote + camisa",
},
{
"id":4463,
"name":"Ingresso promocional"
}
]
}
}
]
}
</pre>
</section><!-- /#evento -->
</section><!-- /#eventos -->
<section id="participantes">
<div class="page-header">
<h1>Participantes</h1>
</div>
<p>Permite acessar a lista de participantes de um evento e informar ao Eventick os participantes cujo check-in já foi realizado. </p>
<section id="lista_part">
<h2>Listagem de Participantes</h2>
<h3>Resource URL</h3>
<pre><code>GET https://www.eventick.com.br/api/v1/events/:event_id/attendees.json</code></pre>
<h3>Parâmetros</h3>
<dl class="dl-horizontal">
<dt>auth_token</dt>
<dd><span>Obrigatório.</span><p>Token necessario para identificação do usuário.</p></dd>
<dt>event_id</dt>
<dd><span>Obrigatório.</span><p>O identificador do evento que você deseja listar os participantes.</p></dd>
<dt>checked_after</dt>
<dd>
<span>Opcional.</span>
<p>Ao informar esse parametro serão retornados apenas os participantes que fizeram após essa hora.</p>
</dd>
</dl>
<h3>Exemplo de Requisição</h3>
<pre><code>$ curl https://www.eventick.com.br/api/v1/events/1706/attendees.json?checked_after=2012-10-17T16:00:00-03:00 \
-u 'YUxHFjkB1x3QHB5ak5qr:'</code></pre>
<h3>Exemplo de Resposta</h3>
<pre class="prettyprint language-javascript linenums">
{
"attendees":[
{
"id": 29,
"name": "Davidson",
"code": "ZVYNDZ",
"ticket_type": "mas",
"checked_at": "2012-10-17T16:54:35-03:00",
"email": "[email protected]"
},
{
"id": 30,
"name": "Cirdes",
"code": "T84LCH",
"ticket_type": "mas",
"checked_at": "",
"email": "[email protected]"
}
]
}
</pre>
</section><!-- /#lista_part -->
<section id="participante">
<h2>Informação de um participante</h2>
<h3>Resource URL</h3>
<pre><code>GET https://www.eventick.com.br/api/v1/events/:event_id/attendees/:id.json</code></pre>
<h3>Parâmetros</h3>
<dl class="dl-horizontal">
<dt>auth_token</dt>
<dd><span>Obrigatório.</span><p>Token necessário para identificação do usuário.</p></dd>
<dt>event_id</dt>
<dd><span>Obrigatório.</span><p>O identificador do evento do participante.</p></dd>
<dt>id</dt>
<dd><span>Obrigatório.</span><p>O identificador do participante.</p></dd>
</dl>
<h3>Exemplo de Requisição</h3>
<pre><code>$ curl https://www.eventick.com.br/api/v1/events/1706/attendees/69782.json \
-u 'f9d93dk211394:'</code></pre>
<h3>Exemplo de Resposta</h3>
<pre class="prettyprint language-javascript linenums">
{
"attendees":[
{
"id": 69782,
"name": "Davidson",
"code": "ZVYNDZ",
"ticket_type": "mas",
"checked_at": "2012-10-17T16:54:35-03:00",
"email": "[email protected]"
}
]
}
</pre>
</section><!-- /#lista_part -->
<section id="check">
<h2>Check-in de um participante</h2>
<p>Permite que você marque um participante como checado (check-in realizado).</p>
<h3>Resource URL</h3>
<pre><code>PUT https://www.eventick.com.br/api/v1/events/:event_id/attendees/:code.json</code></pre>
<h3>Parâmetros</h3>
<dl class="dl-horizontal">
<dt>auth_token</dt>
<dd><span>Obrigatório.</span><p>Token necessário para identificação do usuário.</p></dd>
<dt>event_id</dt>
<dd><span>Obrigatório.</span><p>O Identificador do evento do qual você deseja listar os participantes.</p></dd>
<dt>code</dt>
<dd><p>Código do ingresso do participante.</p></dd>
<dt>checked_at</dt>
<dd><p>Especifica a hora que o participante foi checado.</p></dd>
</dl>
<h3>Exemplo de Requisição</h3>
<pre><code>$ curl -X PUT https://www.eventick.com.br/api/v1/events/1706/attendees/AD1243.json \
-u "f9d93dk211394:" \
-d "checked_at=2012-10-17T16:54:35-03:00" </code></pre>
</section><!-- /#checking -->
<section id="check-all">
<h2>Check-in de vários participantes</h2>
<p>Permite que você marque vários participantes como checados. É preciso adicionar o "Content-Type: application/json" no cabeçalho da requisição.</p>
<h3>Resource URL</h3>
<pre><code>PUT https://www.eventick.com.br/api/v1/events/:event_id/attendees/check_all.json</code></pre>
<h3>Parâmetros</h3>
<dl class="dl-horizontal">
<dt>auth_token</dt>
<dd><span>Obrigatório.</span><p>Token necessário para identificação do usuário.</p></dd>
<dt>event_id</dt>
<dd><span>Obrigatório.</span><p>O Identificador do evento do qual você deseja listar os participantes.</p></dd>
<dt>attendees</dt>
<dd><p>Os participantes a serem checados devem ser enviados nos formato JSON. Ex: <code>{ "id": 10, "checked_at": "2012-10-17T16:54:35-03:00"}</code></p></dd>
</dl>
<h3>Exemplo de Requisição</h3>
<pre><code>$ curl -X PUT https://www.eventick.com.br/api/v1/events/:event_id/attendees/check_all.json \
-u "f9d93dk211394:" \
-H "Content-Type: application/json" \
-d '{"attendees":[{"id":10,"checked_at":"2012-10-17T16:54:35-03:00"}]}'</code></pre>
</section><!-- /#checking -->
</section><!-- /#participantes-->
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p>Designed by <a href="http://www.eventick.com.br">Eventick</a> © 2013 with <a href="http://twitter.github.io/bootstrap/">Bootstrap</a></p>
<ul class="footer-links inline">
<li><a href="http://blog.eventick.com.br">Blog</a></li>
<li class="muted">·</li>
<li><a href="mailto:[email protected]">Achou um bug? Avise a gente!</a></li>
</ul>
</div>
</footer>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap-transition.js"></script>
<script src="assets/js/bootstrap-alert.js"></script>
<script src="assets/js/bootstrap-modal.js"></script>
<script src="assets/js/bootstrap-dropdown.js"></script>
<script src="assets/js/bootstrap-scrollspy.js"></script>
<script src="assets/js/bootstrap-tab.js"></script>
<script src="assets/js/bootstrap-tooltip.js"></script>
<script src="assets/js/bootstrap-popover.js"></script>
<script src="assets/js/bootstrap-button.js"></script>
<script src="assets/js/bootstrap-collapse.js"></script>
<script src="assets/js/bootstrap-carousel.js"></script>
<script src="assets/js/bootstrap-typeahead.js"></script>
<script src="assets/js/bootstrap-affix.js"></script>
<script src="assets/js/google-code-prettify/prettify.js"></script>
<script src="assets/js/main.js"></script>
<script>
!function ($) {
$(function(){
window.prettyPrint && prettyPrint()
})
}(window.jQuery)
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-26139355-4', 'eventick.com.br');
ga('send', 'pageview');
</script>
</body>
</html>