-
Notifications
You must be signed in to change notification settings - Fork 6
/
collaborators.html
161 lines (133 loc) · 8.22 KB
/
collaborators.html
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
---
layout: default
title: Collaborators
---
<div class='row'><div class='col-xs-12 col-sm-6 sidebar-text'><h1 id="collaborators">Collaborators</h1>
</div><div class='hidden-xs col-xs-12 col-sm-6 sidebar-code'></div></div><div class='row'><div class='col-xs-12 col-sm-6 sidebar-text'>
<p><strong>Collaborator attributes</strong></p>
<table class="table">
<thead>
<tr>
<th>field</th>
<th>type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>string</td>
<td>unique ID</td>
</tr>
<tr>
<td>email</td>
<td>string</td>
<td>email address</td>
</tr>
<tr>
<td>username</td>
<td>string</td>
<td>username (“n/a”: invitation is still pending)</td>
</tr>
<tr>
<td>status</td>
<td>string</td>
<td><strong>pending</strong>: invitation not yet accepted, <strong>accepted</strong>: invitation has been accepted</td>
</tr>
</tbody>
</table>
</div><div class='col-xs-12 col-sm-6 sidebar-code'>
<p>Example object:</p>
<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[email protected]"</span><span class="p">,</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"54101e25736f7563d5060000"</span><span class="p">,</span><span class="w">
</span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"accepted"</span><span class="p">,</span><span class="w">
</span><span class="s2">"username"</span><span class="p">:</span><span class="w"> </span><span class="s2">"soulou"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
</div>
</div></div><div class='row'><div class='col-xs-12 col-sm-6 sidebar-text'>
<h2 id="list-collaborators-of-an-app">List collaborators of an app</h2>
</div><div class='hidden-xs col-xs-12 col-sm-6 sidebar-code'></div></div><div class='row'><div class='col-xs-12 col-sm-6 sidebar-text'>
<p><code class="highlighter-rouge">GET https://api.scalingo.com/v1/apps/[:app]/collaborators</code></p>
<p>List all the collabors of an app, except the owner. It also displays
the state of the invitation of thoses collaborators.</p>
</div><div class='col-xs-12 col-sm-6 sidebar-code'>
<p>Example Request</p>
<div class="highlighter-rouge"><pre class="highlight"><code>curl -H <span class="s2">"Accept: application/json"</span> -H <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
-X GET -u :<span class="nv">$AUTH_TOKEN</span> https://api.scalingo.com/v1/apps/[:app]/collaborators
</code></pre>
</div>
<p>Returns 200 OK</p>
<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="s2">"collaborators"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[email protected]"</span><span class="p">,</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"54101e25736f7563d5060000"</span><span class="p">,</span><span class="w">
</span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"accepted"</span><span class="p">,</span><span class="w">
</span><span class="s2">"username"</span><span class="p">:</span><span class="w"> </span><span class="s2">"soulou"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[email protected]"</span><span class="p">,</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"54102274736f7563d5070000"</span><span class="p">,</span><span class="w">
</span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"pending"</span><span class="p">,</span><span class="w">
</span><span class="s2">"username"</span><span class="p">:</span><span class="w"> </span><span class="s2">"n/a"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
</div>
</div></div><div class='row'><div class='col-xs-12 col-sm-6 sidebar-text'>
<h2 id="add-collaborators-to-an-app">Add collaborators to an app</h2>
</div><div class='hidden-xs col-xs-12 col-sm-6 sidebar-code'></div></div><div class='row'><div class='col-xs-12 col-sm-6 sidebar-text'>
<p><code class="highlighter-rouge">POST https://api.scalingo.com/v1/apps/[:app]/collaborators</code></p>
<p>This action will create an invitation to the given person. You can invite
either someone with an account on Scalingo or someone new. In the second case,
they will be able to access the application after creating their account.</p>
<blockquote>
<p>Note: An email will be sent to the invited user.</p>
</blockquote>
<p>Parameters:</p>
<ul>
<li><code class="highlighter-rouge">collaborator.email</code>: Email address of the collaborator to invite</li>
</ul>
</div><div class='col-xs-12 col-sm-6 sidebar-code'>
<div class="highlighter-rouge"><pre class="highlight"><code>
Example Request
curl -H <span class="s2">"Accept: application/json"</span> -H <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
-X POST -u :<span class="nv">$AUTH_TOKEN</span> https://api.scalingo.com/v1/apps/[:app]/collaborators -d <span class="se">\</span>
<span class="s1">'{
"collaborator": {
"email":"[email protected]"
}
}'</span>
</code></pre>
</div>
<p>Returns 201 Created</p>
<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="s2">"collaborators"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[email protected]"</span><span class="p">,</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"54101e25736f7563d5060000"</span><span class="p">,</span><span class="w">
</span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"pending"</span><span class="p">,</span><span class="w">
</span><span class="s2">"username"</span><span class="p">:</span><span class="w"> </span><span class="s2">"n/a"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
</div>
</div></div><div class='row'><div class='col-xs-12 col-sm-6 sidebar-text'>
<h2 id="delete-a-collaborator">Delete a collaborator</h2>
</div><div class='hidden-xs col-xs-12 col-sm-6 sidebar-code'></div></div><div class='row'><div class='col-xs-12 col-sm-6 sidebar-text'>
<p><code class="highlighter-rouge">DELETE https://api.scalingo.com/v1/apps/[:app]/collaborators/[:collaborator_id]</code></p>
<p>This action completely remove a collaborator from an app. Only the owner of the
app can execute it. The user won’t be able to access, nor to deploy it.</p>
</div><div class='col-xs-12 col-sm-6 sidebar-code'>
<div class="highlighter-rouge"><pre class="highlight"><code>
Example Request
curl -H <span class="s2">"Accept: application/json"</span> -H <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
-X DELETE -u :<span class="nv">$AUTH_TOKEN</span> https://api.scalingo.com/v1/apps/[:app]/collaborators/54101e25736f7563d5060000
</code></pre>
</div>
<p>Returns 204 No Content</p>
</div></div>