-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.http
More file actions
54 lines (40 loc) · 1.1 KB
/
Copy pathrequests.http
File metadata and controls
54 lines (40 loc) · 1.1 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
@base = http://localhost:3000
@email = you@example.com
@password = SuperSecret123
### Register
# @name register
POST {{base}}/v1/auth/register
Content-Type: application/json
{ "email": "{{email}}", "password": "{{password}}" }
###
@token = {{register.response.body.accessToken}}
@refresh = {{register.response.body.refreshToken}}
### Login
POST {{base}}/v1/auth/login
Content-Type: application/json
{ "email": "{{email}}", "password": "{{password}}" }
### Me
GET {{base}}/v1/auth/me
Authorization: Bearer {{token}}
### Create a link
# @name createLink
POST {{base}}/v1/links
Authorization: Bearer {{token}}
Content-Type: application/json
Idempotency-Key: demo-1
{ "target": "https://example.com/article" }
###
@linkId = {{createLink.response.body.id}}
@code = {{createLink.response.body.code}}
### List links
GET {{base}}/v1/links?limit=10
Authorization: Bearer {{token}}
### Public redirect
GET {{base}}/{{code}}
### Stats
GET {{base}}/v1/links/{{linkId}}/stats?interval=day
Authorization: Bearer {{token}}
### Refresh
POST {{base}}/v1/auth/refresh
Content-Type: application/json
{ "refreshToken": "{{refresh}}" }