-
Notifications
You must be signed in to change notification settings - Fork 8
/
api-requests.http
56 lines (42 loc) · 1.21 KB
/
api-requests.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
// Various requests made by CON / TP to the API.
// Use this file with VsCode and this extension:
// https://marketplace.visualstudio.com/items?itemName=humao.rest-client
// This gives you "Send Request" buttons.
@randomUsernamePasswordToken = eric+{{$timestamp}}@binarylights.com
@apiUrl = http://localhost:3003/api
@companyName = Company ABC
@firstName = ReDI
@lastName = Superstar
# @name signup
POST {{apiUrl}}/redUsers
Content-Type: application/json
RedProduct: TP
{
"email": "{{randomUsernamePasswordToken}}",
"password": "{{randomUsernamePasswordToken}}"
}
###
@usernamePasswordToken = {{signup.response.body.email}}
@userId = {{signup.response.body.id}}
# @name login
POST {{apiUrl}}/redUsers/login
Content-Type: application/json
RedProduct: TP
{
"email": "{{usernamePasswordToken}}",
"password": "{{usernamePasswordToken}}"
}
###
@accessToken = {{login.response.body.id}}
# @name createTpCompanyProfile
POST {{apiUrl}}/redUsers/{{userId}}/tpCompanyProfile
Content-Type: application/json
Authorization: {{accessToken}}
RedProduct: TP
{
"firstName": "{{companyName}}",
"lastName": "{{firstName}}",
"companyName": "{{lastName}}",
"contactEmail": "{{usernamePasswordToken}}",
"state": "drafting-profile"
}