-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.http
107 lines (78 loc) · 2.12 KB
/
api.http
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
##* Hello world
GET http://localhost:3333
@base_url = http://localhost:3333
###! Create Partner
POST {{base_url}}/partners
Content-Type: application/json
{
"name": "Partner name"
}
###* List Partners
GET {{base_url}}/partners
@partner_id = 460b73a2-9c59-48fa-9080-d48a7f0773c7
###! Create Customer
POST {{base_url}}/customers
Content-Type: application/json
{
"name": "Customer name",
"cpf": "035209851-10"
}
###* List Customers
GET {{base_url}}/customers
@customer_id = 6db468b6-3341-4fa0-8f11-ce50e490e401
###! Create Event
POST {{base_url}}/events
Content-Type: application/json
{
"name": "event name",
"description": "event description",
"date": "2020-01-01T00:00:00.000Z",
"partner_id": "{{partner_id}}"
}
###* List Events
GET {{base_url}}/events
@event_id = 11c2050d-3f7e-4e5b-895e-4e61c16138a4
###? Publish event
PATCH {{base_url}}/events/{{event_id}}/publish-all
###? Unpublish event
PATCH {{base_url}}/events/{{event_id}}/unpublish-all
###! Create Event Section
POST {{base_url}}/events/{{event_id}}/sections
Content-Type: application/json
{
"name": "event section name",
"description": "event section description",
"total_spots": 1,
"price": 100.00
}
###
@section_id = 5b4d02fb-599d-46ad-86d9-2517fc2ff525
@spot_id = e0baa558-90b7-4c07-b72e-5e857e52017c
###* List sections of event
GET {{base_url}}/events/{{event_id}}/sections
###? Update section of event
PUT {{base_url}}/events/{{event_id}}/sections/{{section_id}}
Content-Type: application/json
{
"name": "updated section name",
"description": "updated section description"
}
###* List spots of section
GET {{base_url}}/events/{{event_id}}/sections/{{section_id}}/spots HTTP/1.1
###? Update spot location
PUT {{base_url}}/events/{{event_id}}/sections/{{section_id}}/spots/{{spot_id}} HTTP/1.1
Content-Type: application/json
{
"location": "spot location"
}
###* List orders
GET {{base_url}}/events/{{event_id}}/orders HTTP/1.1
###! Create Order
POST {{base_url}}/events/{{event_id}}/orders
Content-Type: application/json
{
"customer_id": "{{customer_id}}",
"section_id": "{{section_id}}",
"spot_id": "{{spot_id}}",
"card_token": "tok_visa"
}