-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrequests.http
More file actions
141 lines (87 loc) · 2.81 KB
/
requests.http
File metadata and controls
141 lines (87 loc) · 2.81 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
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
# Keywordista API — manual exercise sheet.
# Works with VS Code "REST Client" extension and JetBrains HTTP Client.
@host = http://127.0.0.1:8080
@contentType = application/json
### 0. Health
GET {{host}}/health
### 2. Add Azri as a watched app
# Save the response's "id" into @azriId below.
POST {{host}}/api/v1/apps
Content-Type: {{contentType}}
{
"appStoreId": 1625870857,
"primaryCountry": "us"
}
### 3. Add Quizlet too (so you have a competitor row)
POST {{host}}/api/v1/apps
Content-Type: {{contentType}}
{
"appStoreId": 546473125,
"primaryCountry": "us"
}
### 4. List watched apps
GET {{host}}/api/v1/apps
### --- Paste the UUIDs from #2 and below ---
@azriId = PASTE-AZRI-UUID-HERE
@quizletId = PASTE-QUIZLET-UUID-HERE
### 5. Add a keyword (immediately triggers the first refresh job)
POST {{host}}/api/v1/keywords
Content-Type: {{contentType}}
{
"term": "flashcards",
"countryCode": "us"
}
### 6. Add another keyword
POST {{host}}/api/v1/keywords
Content-Type: {{contentType}}
{
"term": "study cards",
"countryCode": "us"
}
### 7. Add a Japanese keyword
POST {{host}}/api/v1/keywords
Content-Type: {{contentType}}
{
"term": "暗記カード",
"countryCode": "jp"
}
### 8. List keywords
GET {{host}}/api/v1/keywords
### --- Paste a keyword UUID from #5 or list response ---
@keywordId = PASTE-KEYWORD-UUID-HERE
### 9. Validation — empty term (expect 400)
POST {{host}}/api/v1/keywords
Content-Type: {{contentType}}
{
"term": " ",
"countryCode": "us"
}
### 10. Validation — bad country code (expect 400)
POST {{host}}/api/v1/keywords
Content-Type: {{contentType}}
{
"term": "flashcards",
"countryCode": "USA"
}
### 11. Force a refresh on one keyword (returns 202 immediately, job runs async)
POST {{host}}/api/v1/keywords/{{keywordId}}/refresh
### 12. Refresh ALL keywords (expect enqueued = total keyword count)
POST {{host}}/api/v1/refresh-all
### 13. Dashboard — all countries
GET {{host}}/api/v1/dashboard
### 14. Dashboard — US only
GET {{host}}/api/v1/dashboard?country=us
### 15. Dashboard — JP only
GET {{host}}/api/v1/dashboard?country=jp
### 16. History for Azri on the keyword (run #11 a few times, then watch this grow)
GET {{host}}/api/v1/keywords/{{keywordId}}/history?watchedAppId={{azriId}}
### 17. History for Quizlet on the same keyword
GET {{host}}/api/v1/keywords/{{keywordId}}/history?watchedAppId={{quizletId}}
### 18. Refresh — unknown keyword (expect 404)
POST {{host}}/api/v1/keywords/00000000-0000-0000-0000-000000000000/refresh
### 19. Delete a keyword (cascades to its rank_checks + top_result_snapshots)
DELETE {{host}}/api/v1/keywords/{{keywordId}}
### 20. Delete a watched app (cascades rank_checks)
DELETE {{host}}/api/v1/apps/{{quizletId}}
### 21. Confirm cascade — dashboard should drop the deleted rows
GET {{host}}/api/v1/dashboard