|
| 1 | +# User Management |
| 2 | + |
| 3 | +## Create Invitation Link |
| 4 | + |
| 5 | +```shell |
| 6 | +curl https://api.simplyprint.io/{id}/users/CreateInvitationLink \ |
| 7 | + -X POST \ |
| 8 | + -H 'accept: application/json' \ |
| 9 | + -H 'X-API-KEY: {API_KEY}' |
| 10 | +``` |
| 11 | + |
| 12 | +> Request body |
| 13 | +
|
| 14 | +```json |
| 15 | +{ |
| 16 | + "maxUses": 10 |
| 17 | +} |
| 18 | +``` |
| 19 | + |
| 20 | +> Success response |
| 21 | +
|
| 22 | +```json |
| 23 | +{ |
| 24 | + "status": true, |
| 25 | + "message": null, |
| 26 | + "link": "https://simplyprint.io/accept_invitation/b3d9b5a0-5b5b-11e9-8d7c-2d3b9e84aafd" |
| 27 | +} |
| 28 | +``` |
| 29 | + |
| 30 | +<aside class="notice"> |
| 31 | + This endpoint requires the <b>Print Farm</b> plan. |
| 32 | +</aside> |
| 33 | + |
| 34 | +| Required permissions | |
| 35 | +| -------------------- | |
| 36 | +| `INVITE_USERS` | |
| 37 | + |
| 38 | +This endpoint creates an invitation link that can be used to invite new users to the company. |
| 39 | +Please note that links with unlimited uses expire at the end of the day. |
| 40 | + |
| 41 | +### Request |
| 42 | + |
| 43 | +`POST /{id}/users/CreateInvitationLink` |
| 44 | + |
| 45 | +| Parameter | Type | Required | Description | |
| 46 | +|-----------|------|----------|-------------| |
| 47 | +| `maxUses` | integer | no | The maximum number of times the link can be used. Specify 0 for unlimited uses. | |
| 48 | + |
| 49 | +### Response |
| 50 | + |
| 51 | +| Parameter | Type | Description | |
| 52 | +|-----------|------|-------------| |
| 53 | +| `status` | boolean | True if the request was successful. | |
| 54 | +| `message` | string | Error message if `status` is false. | |
| 55 | +| `link` | string | The invitation link. | |
| 56 | + |
| 57 | +## Invite Users By Email |
| 58 | + |
| 59 | +```shell |
| 60 | +curl https://api.simplyprint.io/{id}/users/InviteSpecificUser \ |
| 61 | + -X POST \ |
| 62 | + -H 'accept: application/json' \ |
| 63 | + -H 'X-API-KEY: {API_KEY}' |
| 64 | +``` |
| 65 | + |
| 66 | +> Request body |
| 67 | +
|
| 68 | +```json |
| 69 | +{ |
| 70 | + "emails": [ |
| 71 | + |
| 72 | + |
| 73 | + ], |
| 74 | + "rank": 192, |
| 75 | + "lang": "en" |
| 76 | +} |
| 77 | +``` |
| 78 | + |
| 79 | +> Success response |
| 80 | +
|
| 81 | +```json |
| 82 | +{ |
| 83 | + "status": true, |
| 84 | + "message": null |
| 85 | +} |
| 86 | +``` |
| 87 | + |
| 88 | +<aside class="notice"> |
| 89 | + This endpoint requires the <b>Print Farm</b> plan. |
| 90 | +</aside> |
| 91 | + |
| 92 | +| Required permissions | |
| 93 | +| -------------------- | |
| 94 | +| `INVITE_USERS` | |
| 95 | + |
| 96 | +This endpoint invites one or more users to the company by email. |
| 97 | + |
| 98 | +### Request |
| 99 | + |
| 100 | +`POST /{id}/users/InviteSpecificUser` |
| 101 | + |
| 102 | +| Parameter | Type | Required | Description | |
| 103 | +|-----------|------|----------|-------------| |
| 104 | +| `emails` | string[] | yes | The emails of the users to invite. | |
| 105 | +| `rank` | integer | no | The rank id that the users should be assigned. | |
| 106 | + |
| 107 | +### Response |
| 108 | + |
| 109 | +| Parameter | Type | Description | |
| 110 | +|-----------|------|-------------| |
| 111 | +| `status` | boolean | True if the request was successful. | |
| 112 | +| `message` | string | Error message if `status` is false. | |
| 113 | + |
| 114 | +## Delete User |
| 115 | + |
| 116 | +```shell |
| 117 | +curl https://api.simplyprint.io/{id}/users/DeleteUser \ |
| 118 | + -X POST \ |
| 119 | + -H 'accept: application/json' \ |
| 120 | + -H 'X-API-KEY: {API_KEY}' |
| 121 | +``` |
| 122 | + |
| 123 | +> Request body |
| 124 | +
|
| 125 | +```json |
| 126 | +{ |
| 127 | + "user_id": 1234 |
| 128 | +} |
| 129 | +``` |
| 130 | + |
| 131 | +> Success response |
| 132 | +
|
| 133 | +```json |
| 134 | +{ |
| 135 | + "status": true, |
| 136 | + "message": null |
| 137 | +} |
| 138 | +``` |
| 139 | + |
| 140 | +<aside class="notice"> |
| 141 | + This endpoint requires the <b>Print Farm</b> plan. |
| 142 | +</aside> |
| 143 | + |
| 144 | +| Required permissions | |
| 145 | +| -------------------- | |
| 146 | +| `DELETE_USER` | |
| 147 | + |
| 148 | +This endpoint deletes a user from the company. Use this endpoint with caution. |
| 149 | + |
| 150 | +### Request |
| 151 | + |
| 152 | +`POST /{id}/users/DeleteUser` |
| 153 | + |
| 154 | +| Parameter | Type | Required | Description | |
| 155 | +|-----------|------|----------|-------------| |
| 156 | +| `user_id` | integer | yes | The id of the user to delete. | |
| 157 | + |
| 158 | +### Response |
| 159 | + |
| 160 | +| Parameter | Type | Description | |
| 161 | +|-----------|------|-------------| |
| 162 | +| `status` | boolean | True if the request was successful. | |
| 163 | +| `message` | string | Error message if `status` is false. | |
| 164 | + |
| 165 | +## Accept or Deny Pending User |
| 166 | + |
| 167 | +```shell |
| 168 | +curl https://api.simplyprint.io/{id}/users/SetPendingUserState \ |
| 169 | + -X ? \ |
| 170 | + -H 'accept: application/json' \ |
| 171 | + -H 'X-API-KEY: {API_KEY}' |
| 172 | +``` |
| 173 | + |
| 174 | +> Success response |
| 175 | +
|
| 176 | +```json |
| 177 | +{ |
| 178 | + "TODO": "TODO" |
| 179 | +} |
| 180 | +``` |
| 181 | + |
| 182 | +### Request |
| 183 | + |
| 184 | +`? /{id}/users/SetPendingUserState` |
| 185 | + |
| 186 | +TODO |
| 187 | + |
| 188 | +## Change User Rank |
| 189 | + |
| 190 | +```shell |
| 191 | +curl https://api.simplyprint.io/{id}/users/ChangeUserRank \ |
| 192 | + -X ? \ |
| 193 | + -H 'accept: application/json' \ |
| 194 | + -H 'X-API-KEY: {API_KEY}' |
| 195 | +``` |
| 196 | + |
| 197 | +> Success response |
| 198 | +
|
| 199 | +```json |
| 200 | +{ |
| 201 | + "TODO": "TODO" |
| 202 | +} |
| 203 | +``` |
| 204 | + |
| 205 | +### Request |
| 206 | + |
| 207 | +`? /{id}/users/ChangeUserRank` |
| 208 | + |
| 209 | +TODO |
| 210 | + |
| 211 | +## Get Company Users |
| 212 | + |
| 213 | +```shell |
| 214 | +curl https://api.simplyprint.io/{id}/users/GetPaginatedUsers \ |
| 215 | + -X POST \ |
| 216 | + -H 'accept: application/json' \ |
| 217 | + -H 'X-API-KEY: {API_KEY}' |
| 218 | +``` |
| 219 | + |
| 220 | +> Request body |
| 221 | +
|
| 222 | +```json |
| 223 | +{ |
| 224 | + "page": 1, |
| 225 | + "page_size": 10, |
| 226 | + "approved": true, |
| 227 | + "search": "John Doe", |
| 228 | + "sort_id": 1, |
| 229 | + "sort_dir": "asc" |
| 230 | +} |
| 231 | +``` |
| 232 | + |
| 233 | +> Success response |
| 234 | +
|
| 235 | +```json |
| 236 | +{ |
| 237 | + "TODO": "TODO" |
| 238 | +} |
| 239 | +``` |
| 240 | + |
| 241 | +<aside class="notice"> |
| 242 | + This endpoint requires the <b>Print Farm</b> plan. |
| 243 | +</aside> |
| 244 | + |
| 245 | +| Required permissions | |
| 246 | +| -------------------- | |
| 247 | +| `VIEW_USERS` | |
| 248 | + |
| 249 | +### Request |
| 250 | + |
| 251 | +`POST /{id}/users/GetPaginatedUsers` |
| 252 | + |
| 253 | +| Parameter | Type | Required | Description | |
| 254 | +|-----------|------|----------|-------------| |
| 255 | +| `page` | integer | yes | The page number to retrieve. | |
| 256 | +| `page_size` | integer | yes | The number of users to retrieve per page. | |
| 257 | +| `approved` | boolean | no | If true, only approved users will be returned. If false, only pending users will be returned.<br>**Defaults to true** | |
| 258 | +| `search` | string | no | A search string to filter the users by. Searches for name, email and phone number. | |
| 259 | +| `sort_id` | integer | no | Which field to sort by. See [Sort IDs](#sort-ids). | |
| 260 | +| `sort_dir` | string | no | The sort direction. Either `asc` or `desc`. | |
| 261 | + |
| 262 | +#### Sort IDs |
| 263 | + |
| 264 | +| ID | Field | |
| 265 | +|----|-------| |
| 266 | +| 0 | Name | |
| 267 | +| 1 | Email | |
| 268 | +| 2 | Rank id | |
| 269 | +| 3 | Last online | |
| 270 | +| 4 | Join date | |
| 271 | +| 5 | Amount of prints | |
0 commit comments