-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.http
More file actions
92 lines (70 loc) · 2.07 KB
/
Copy pathsample.http
File metadata and controls
92 lines (70 loc) · 2.07 KB
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
# USER REGISTRATION, LOGIN AND LOGOUT ACTIONS AND ENDPOINTS
# Register a new user
POST http://127.0.0.1:8000/api/users/register/ HTTP/1.1
content-type: application/json
{
"username": "yourusername",
"email": "youruseremail",
"password": "youruserpassword"
}
#########
# Login registered users
POST http://127.0.0.1:8000/api/users/login/ HTTP/1.1
content-type: application/json
{
"username": "yourusername",
"password": "youruserpassword@145!"
}
#######
# Logging out a logged in user
GET http://127.0.0.1:8000/api/users/logout/ HTTP/1.1
Authorization: Token generated token
#######
# EVENT MANAGEMENT CRUD OPERATIONS
# Creating a new event
POST http://127.0.0.1:8000/api/events/create-event/ HTTP/1.1
content-type: application/json
Authorization: Token generated token
{
"title": "Event Title",
"description": "event description",
"date": "*set the date*",
"location": "Nairobi",
"tags":[`Add a list of tags (strings)`],
"ticket_price": (float-field required)
}
#######
# listing all events
GET http://127.0.0.1:8000/api/events/list-events/ HTTP/1.1
Authorization: Token generated token
#######
# Filter events list with specific query parameters
GET http://127.0.0.1:8000/api/events/list-events/?tags=`enter tag name` HTTP/1.1
Authorization: Token generated token
#######
# listing all upcoming events
GET http://127.0.0.1:8000/api/events/upcoming/ HTTP/1.1
Authorization: Token generated token
#######
# Retrieving a specific event
GET http://127.0.0.1:8000/api/events/1/ HTTP/1.1
Authorization: Token generated token
#######
# Edit or update a specific event
PUT http://127.0.0.1:8000/api/events/1/edit/ HTTP/1.1
content-type: application/json
Authorization: Token generated token
{
"title": "Event Title",
"description": "event description",
"date": "*set the date*",
"location": "Nairobi",
"tags":[`Add a list of tags (strings)`],
"ticket_price": (float-field required)
}
#######
# Delete a specific event
DELETE http://127.0.0.1:8000/api/events/3/delete/ HTTP/1.1
content-type: application/json
Authorization: Token generated token
#######