-
Notifications
You must be signed in to change notification settings - Fork 9
/
passport.apib
123 lines (73 loc) · 2.06 KB
/
passport.apib
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
FORMAT: 1A
HOST: https://passport.thegrid.io/
# The Grid Passport
The Grid Passport is The Grid's account system that is responsible for access control and user account information.
# Group User
## User information [/api/user]
### Get currently authenticated user [GET]
+ Response 200 (application/json)
+ Body
```
<!-- include(examples/user-with-avatar.json) -->
```
+ Schema
```
<!-- include(full-schema/user.json) -->
```
### Update user information [PUT]
Update the current user's profile information, for example to add missing details. The request payload should be a JSON-encoded object containing the following keys:
+ email (required, string) - new email address for the user
+ name (string) - User's real name
+ Response 200 (application/json)
User information was successfully updated
+ Body
+ Response 422
Missing details
+ Body
## Information about other users [/api/user/{id}]
+ Parameters
+ id (required, string) - User UUID
### Get user information [GET]
+ Response 200 (application/json)
+ Body
```
<!-- include(examples/user-without-email.json) -->
```
+ Schema
```
<!-- include(full-schema/user.json) -->
```
## User's public GitHub Token [/api/user/github]
### Get GitHub token for the authenticated user [GET]
This API call requires the `github` scope.
+ Response 403
Failed OAuth or missing `github` scope.
+ Body
+ Response 404
No public GitHub token available
+ Body
+ Response 200 (application/json)
+ Body
```
{
"username": "grid-bot",
"token": "nijcoqf3h3287f7g"
}
```
## User's private GitHub Token [/api/user/github_private]
### Get GitHub token for the authenticated user [GET]
This API call requires the `github` scope.
+ Response 403
Failed OAuth or missing `github` scope.
+ Body
+ Response 404
No private GitHub token available
+ Body
+ Response 200 (application/json)
+ Body
```
{
"username": "grid-bot",
"token": "nijcoqf3h3287f7g"
}
```