BigW Consortium Gitlab

users.md 19.1 KB
Newer Older
1 2
# Users

3 4 5
## List users

Get a list of users.
6

7
This function takes pagination parameters `page` and `per_page` to restrict the list of users.
8

Ciro Santilli committed
9
### For normal users
10 11 12 13 14 15 16 17 18 19 20 21 22

```
GET /users
```

```json
[
  {
    "id": 1,
    "username": "john_smith",
    "name": "John Smith",
    "state": "active",
    "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
23
    "web_url": "http://localhost:3000/john_smith"
24 25 26 27 28 29 30
  },
  {
    "id": 2,
    "username": "jack_smith",
    "name": "Jack Smith",
    "state": "blocked",
    "avatar_url": "http://gravatar.com/../e32131cd8.jpeg",
31
    "web_url": "http://localhost:3000/jack_smith"
32 33 34 35
  }
]
```

36 37 38 39 40 41 42 43 44 45 46 47
In addition, you can filter users based on states eg. `blocked`, `active`
This works only to filter users who are `blocked` or `active`.
It does not support `active=false` or `blocked=false`.

```
GET /users?active=true
```

```
GET /users?blocked=true
```

Ciro Santilli committed
48
### For admins
49

50 51 52 53 54 55 56 57
```
GET /users
```

```json
[
  {
    "id": 1,
58
    "username": "john_smith",
59 60
    "email": "john@example.com",
    "name": "John Smith",
61
    "state": "active",
62
    "avatar_url": "http://localhost:3000/uploads/user/avatar/1/index.jpg",
63
    "web_url": "http://localhost:3000/john_smith",
64
    "created_at": "2012-05-23T08:00:58Z",
65
    "is_admin": false,
66
    "bio": null,
67
    "location": null,
68 69 70
    "skype": "",
    "linkedin": "",
    "twitter": "",
Jerome Dalbert committed
71
    "website_url": "",
72
    "organization": "",
73 74
    "last_sign_in_at": "2012-06-01T11:41:01Z",
    "confirmed_at": "2012-05-23T09:05:22Z",
75
    "theme_id": 1,
76
    "color_scheme_id": 2,
77 78 79 80 81 82 83
    "projects_limit": 100,
    "current_sign_in_at": "2012-06-02T06:36:55Z",
    "identities": [
      {"provider": "github", "extern_uid": "2435223452345"},
      {"provider": "bitbucket", "extern_uid": "john.smith"},
      {"provider": "google_oauth2", "extern_uid": "8776128412476123468721346"}
    ],
84
    "can_create_group": true,
85 86 87
    "can_create_project": true,
    "two_factor_enabled": true,
    "external": false
88 89 90
  },
  {
    "id": 2,
91
    "username": "jack_smith",
92 93
    "email": "jack@example.com",
    "name": "Jack Smith",
94
    "state": "blocked",
95
    "avatar_url": "http://localhost:3000/uploads/user/avatar/2/index.jpg",
96
    "web_url": "http://localhost:3000/jack_smith",
97
    "created_at": "2012-05-23T08:01:01Z",
98
    "is_admin": false,
99
    "bio": null,
100
    "location": null,
101 102 103
    "skype": "",
    "linkedin": "",
    "twitter": "",
Jerome Dalbert committed
104
    "website_url": "",
105
    "organization": "",
106 107
    "last_sign_in_at": null,
    "confirmed_at": "2012-05-30T16:53:06.148Z",
108
    "theme_id": 1,
109
    "color_scheme_id": 3,
110
    "projects_limit": 100,
111
    "current_sign_in_at": "2014-03-19T17:54:13Z",
112 113 114 115 116
    "identities": [],
    "can_create_group": true,
    "can_create_project": true,
    "two_factor_enabled": true,
    "external": false
117 118 119 120
  }
]
```

Ciro Santilli committed
121
You can search for users by email or username with: `/users?search=John`
dosire committed
122

123 124 125 126 127 128 129 130 131 132 133
In addition, you can lookup users by username:

```
GET /users?username=:username
```

For example:

```
GET /users?username=jack_smith
```
134

135 136
You can search for users who are external with: `/users?external=true`

137 138 139 140
## Single user

Get a single user.

Ciro Santilli committed
141
### For user
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157

```
GET /users/:id
```

Parameters:

- `id` (required) - The ID of a user

```json
{
  "id": 1,
  "username": "john_smith",
  "name": "John Smith",
  "state": "active",
  "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
158
  "web_url": "http://localhost:3000/john_smith",
159 160 161
  "created_at": "2012-05-23T08:00:58Z",
  "is_admin": false,
  "bio": null,
162
  "location": null,
163 164 165
  "skype": "",
  "linkedin": "",
  "twitter": "",
166 167
  "website_url": "",
  "organization": ""
168 169 170
}
```

Ciro Santilli committed
171
### For admin
172

173 174 175 176 177 178
```
GET /users/:id
```

Parameters:

179
- `id` (required) - The ID of a user
180 181 182 183

```json
{
  "id": 1,
184
  "username": "john_smith",
185 186
  "email": "john@example.com",
  "name": "John Smith",
187
  "state": "active",
188
  "avatar_url": "http://localhost:3000/uploads/user/avatar/1/index.jpg",
189
  "web_url": "http://localhost:3000/john_smith",
190
  "created_at": "2012-05-23T08:00:58Z",
191
  "is_admin": false,
192
  "bio": null,
193
  "location": null,
194 195 196
  "skype": "",
  "linkedin": "",
  "twitter": "",
Jerome Dalbert committed
197
  "website_url": "",
198
  "organization": "",
199 200
  "last_sign_in_at": "2012-06-01T11:41:01Z",
  "confirmed_at": "2012-05-23T09:05:22Z",
201
  "theme_id": 1,
202
  "color_scheme_id": 2,
203 204 205 206 207 208 209
  "projects_limit": 100,
  "current_sign_in_at": "2012-06-02T06:36:55Z",
  "identities": [
    {"provider": "github", "extern_uid": "2435223452345"},
    {"provider": "bitbucket", "extern_uid": "john.smith"},
    {"provider": "google_oauth2", "extern_uid": "8776128412476123468721346"}
  ],
210
  "can_create_group": true,
211
  "can_create_project": true,
212 213
  "two_factor_enabled": true,
  "external": false
214 215 216
}
```

217
## User creation
218 219

Creates a new user. Note only administrators can create new users.
220 221 222 223 224 225 226

```
POST /users
```

Parameters:

227 228 229 230 231
- `email` (required)            - Email
- `password` (required)         - Password
- `username` (required)         - Username
- `name` (required)             - Name
- `skype` (optional)            - Skype ID
Ciro Santilli committed
232
- `linkedin` (optional)         - LinkedIn
233
- `twitter` (optional)          - Twitter account
Ciro Santilli committed
234
- `website_url` (optional)      - Website URL
235
- `organization` (optional)     - Organization name
236 237 238
- `projects_limit` (optional)   - Number of projects user can create
- `extern_uid` (optional)       - External UID
- `provider` (optional)         - External provider name
Ciro Santilli committed
239
- `bio` (optional)              - User's biography
240
- `location` (optional)         - User's location
241 242
- `admin` (optional)            - User is admin - true or false (default)
- `can_create_group` (optional) - User can create groups - true or false
243
- `confirm` (optional)          - Require confirmation - true (default) or false
244
- `external` (optional)         - Flags the user as external - true or false(default)
245

246
## User modification
247 248

Modifies an existing user. Only administrators can change attributes of a user.
249 250 251 252 253 254

```
PUT /users/:id
```

Parameters:
255

Ciro Santilli committed
256 257 258 259 260 261 262 263
- `email`                       - Email
- `username`                    - Username
- `name`                        - Name
- `password`                    - Password
- `skype`                       - Skype ID
- `linkedin`                    - LinkedIn
- `twitter`                     - Twitter account
- `website_url`                 - Website URL
264
- `organization`                - Organization name
Ciro Santilli committed
265 266 267 268
- `projects_limit`              - Limit projects each user can create
- `extern_uid`                  - External UID
- `provider`                    - External provider name
- `bio`                         - User's biography
269
- `location` (optional)         - User's location
Ciro Santilli committed
270 271
- `admin` (optional)            - User is admin - true or false (default)
- `can_create_group` (optional) - User can create groups - true or false
272
- `external` (optional)         - Flags the user as external - true or false(default)
Ciro Santilli committed
273

274 275
Note, at the moment this method does only return a `404` error,
even in cases where a `409` (Conflict) would be more appropriate,
Ciro Santilli committed
276
e.g. when renaming the email address to some existing one.
277 278

## User deletion
279

Ciro Santilli committed
280 281
Deletes a user. Available only for administrators.
This is an idempotent function, calling this function for a non-existent user id
282
still returns a status code `200 OK`.
Ciro Santilli committed
283 284
The JSON response differs if the user was actually deleted or not.
In the former the user is returned and in the latter not.
285 286 287 288 289

```
DELETE /users/:id
```

290 291
Parameters:

292
- `id` (required) - The ID of the user
293

294 295 296
## User

### For normal users
297

298
Gets currently authenticated user.
299 300 301 302 303 304 305 306

```
GET /user
```

```json
{
  "id": 1,
307
  "username": "john_smith",
308 309
  "email": "john@example.com",
  "name": "John Smith",
310
  "state": "active",
311
  "avatar_url": "http://localhost:3000/uploads/user/avatar/1/index.jpg",
312
  "web_url": "http://localhost:3000/john_smith",
313
  "created_at": "2012-05-23T08:00:58Z",
314
  "is_admin": false,
315
  "bio": null,
316
  "location": null,
317 318 319
  "skype": "",
  "linkedin": "",
  "twitter": "",
Jerome Dalbert committed
320
  "website_url": "",
321
  "organization": "",
322 323
  "last_sign_in_at": "2012-06-01T11:41:01Z",
  "confirmed_at": "2012-05-23T09:05:22Z",
324 325
  "theme_id": 1,
  "color_scheme_id": 2,
326 327 328 329 330 331 332
  "projects_limit": 100,
  "current_sign_in_at": "2012-06-02T06:36:55Z",
  "identities": [
    {"provider": "github", "extern_uid": "2435223452345"},
    {"provider": "bitbucket", "extern_uid": "john_smith"},
    {"provider": "google_oauth2", "extern_uid": "8776128412476123468721346"}
  ],
333
  "can_create_group": true,
334
  "can_create_project": true,
335
  "two_factor_enabled": true,
336
  "external": false
337 338
}
```
339

340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
### For admins

Parameters:

- `sudo` (required) - the ID of a user

```
GET /user
```

```json
{
  "id": 1,
  "username": "john_smith",
  "email": "john@example.com",
  "name": "John Smith",
  "state": "active",
  "avatar_url": "http://localhost:3000/uploads/user/avatar/1/index.jpg",
  "web_url": "http://localhost:3000/john_smith",
  "created_at": "2012-05-23T08:00:58Z",
  "is_admin": false,
  "bio": null,
  "location": null,
  "skype": "",
  "linkedin": "",
  "twitter": "",
  "website_url": "",
  "organization": "",
  "last_sign_in_at": "2012-06-01T11:41:01Z",
  "confirmed_at": "2012-05-23T09:05:22Z",
  "theme_id": 1,
  "color_scheme_id": 2,
  "projects_limit": 100,
  "current_sign_in_at": "2012-06-02T06:36:55Z",
  "identities": [
    {"provider": "github", "extern_uid": "2435223452345"},
    {"provider": "bitbucket", "extern_uid": "john_smith"},
    {"provider": "google_oauth2", "extern_uid": "8776128412476123468721346"}
  ],
  "can_create_group": true,
  "can_create_project": true,
  "two_factor_enabled": true,
  "external": false,
  "private_token": "dd34asd13as"
}
```

387 388 389 390 391 392 393 394 395 396 397 398
## List SSH keys

Get a list of currently authenticated user's SSH keys.

```
GET /user/keys
```

```json
[
  {
    "id": 1,
399
    "title": "Public key",
400 401
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
    "created_at": "2014-08-01T14:47:39.080Z"
402 403 404
  },
  {
    "id": 3,
405
    "title": "Another Public key",
406 407
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
    "created_at": "2014-08-01T14:47:39.080Z"
408 409 410 411
  }
]
```

412 413
Parameters:

414
- **none**
415

416 417 418 419 420
## List SSH keys for user

Get a list of a specified user's SSH keys. Available only for admin

```
421
GET /users/:id/keys
422 423 424 425
```

Parameters:

426
- `id` (required) - id of specified user
427

428 429 430 431 432
## Single SSH key

Get a single key.

```
433
GET /user/keys/:key_id
434 435 436 437
```

Parameters:

438
- `key_id` (required) - The ID of an SSH key
439 440 441 442

```json
{
  "id": 1,
443
  "title": "Public key",
444 445
  "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=",
  "created_at": "2014-08-01T14:47:39.080Z"
446 447
}
```
448

449 450
## Add SSH key

451
Creates a new key owned by the currently authenticated user.
452 453 454 455 456 457 458

```
POST /user/keys
```

Parameters:

459
- `title` (required) - new SSH Key's title
Ciro Santilli committed
460
- `key` (required)   - new SSH key
461

462 463 464 465 466 467 468 469 470
```json
{
  "created_at": "2015-01-21T17:44:33.512Z",
  "key": "ssh-dss AAAAB3NzaC1kc3MAAACBAMLrhYgI3atfrSD6KDas1b/3n6R/HP+bLaHHX6oh+L1vg31mdUqK0Ac/NjZoQunavoyzqdPYhFz9zzOezCrZKjuJDS3NRK9rspvjgM0xYR4d47oNZbdZbwkI4cTv/gcMlquRy0OvpfIvJtjtaJWMwTLtM5VhRusRuUlpH99UUVeXAAAAFQCVyX+92hBEjInEKL0v13c/egDCTQAAAIEAvFdWGq0ccOPbw4f/F8LpZqvWDydAcpXHV3thwb7WkFfppvm4SZte0zds1FJ+Hr8Xzzc5zMHe6J4Nlay/rP4ewmIW7iFKNBEYb/yWa+ceLrs+TfR672TaAgO6o7iSRofEq5YLdwgrwkMmIawa21FrZ2D9SPao/IwvENzk/xcHu7YAAACAQFXQH6HQnxOrw4dqf0NqeKy1tfIPxYYUZhPJfo9O0AmBW2S36pD2l14kS89fvz6Y1g8gN/FwFnRncMzlLY/hX70FSc/3hKBSbH6C6j8hwlgFKfizav21eS358JJz93leOakJZnGb8XlWvz1UJbwCsnR2VEY8Dz90uIk1l/UqHkA= loic@call",
  "title": "ABC",
  "id": 4
}
```

471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486
Will return created key with status `201 Created` on success. If an
error occurs a `400 Bad Request` is returned with a message explaining the error:

```json
{
  "message": {
    "fingerprint": [
      "has already been taken"
    ],
    "key": [
      "has already been taken"
    ]
  }
}
```

487 488 489 490 491 492 493 494 495 496
## Add SSH key for user

Create new key owned by specified user. Available only for admin

```
POST /users/:id/keys
```

Parameters:

Ciro Santilli committed
497
- `id` (required)    - id of specified user
498
- `title` (required) - new SSH Key's title
Ciro Santilli committed
499
- `key` (required)   - new SSH key
500

501
## Delete SSH key for current user
502

Ciro Santilli committed
503 504
Deletes key owned by currently authenticated user.
This is an idempotent function and calling it on a key that is already deleted
505
or not available results in `200 OK`.
506 507

```
508
DELETE /user/keys/:key_id
509 510 511 512
```

Parameters:

513
- `key_id` (required) - SSH key ID
514

515
## Delete SSH key for given user
516 517 518 519

Deletes key owned by a specified user. Available only for admin.

```
520
DELETE /users/:id/keys/:key_id
521 522 523 524
```

Parameters:

525 526
- `id` (required) - id of specified user
- `key_id` (required)  - SSH key ID
527

528
Will return `200 OK` on success, or `404 Not found` if either user or key cannot be found.
529

530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559
## List emails

Get a list of currently authenticated user's emails.

```
GET /user/emails
```

```json
[
  {
    "id": 1,
    "email": "email@example.com"
  },
  {
    "id": 3,
    "email": "email2@example.com"
  }
]
```

Parameters:

- **none**

## List emails for user

Get a list of a specified user's emails. Available only for admin

```
560
GET /users/:id/emails
561 562 563 564
```

Parameters:

565
- `id` (required) - id of specified user
566

Douwe Maan committed
567
## Single email
568

Douwe Maan committed
569
Get a single email.
570 571

```
572
GET /user/emails/:email_id
573 574 575 576
```

Parameters:

577
- `email_id` (required) - email ID
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604

```json
{
  "id": 1,
  "email": "email@example.com"
}
```

## Add email

Creates a new email owned by the currently authenticated user.

```
POST /user/emails
```

Parameters:

- `email` (required) - email address

```json
{
  "id": 4,
  "email": "email@example.com"
}
```

Douwe Maan committed
605
Will return created email with status `201 Created` on success. If an
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637
error occurs a `400 Bad Request` is returned with a message explaining the error:

```json
{
  "message": {
    "email": [
      "has already been taken"
    ]
  }
}
```

## Add email for user

Create new email owned by specified user. Available only for admin

```
POST /users/:id/emails
```

Parameters:

- `id` (required)    - id of specified user
- `email` (required) - email address

## Delete email for current user

Deletes email owned by currently authenticated user.
This is an idempotent function and calling it on a email that is already deleted
or not available results in `200 OK`.

```
638
DELETE /user/emails/:email_id
639 640 641 642
```

Parameters:

643
- `email_id` (required) - email ID
644 645 646 647 648 649

## Delete email for given user

Deletes email owned by a specified user. Available only for admin.

```
650
DELETE /users/:id/emails/:email_id
651 652 653 654
```

Parameters:

655 656
- `id` (required) - id of specified user
- `email_id` (required)  - email ID
657

Douwe Maan committed
658
Will return `200 OK` on success, or `404 Not found` if either user or email cannot be found.
659

660 661 662 663 664
## Block user

Blocks the specified user.  Available only for admin.

```
665
PUT /users/:id/block
666 667 668 669
```

Parameters:

670
- `id` (required) - id of specified user
671

672
Will return `200 OK` on success, `404 User Not Found` is user cannot be found or
673
`403 Forbidden` when trying to block an already blocked user by LDAP synchronization.
674 675 676 677 678 679

## Unblock user

Unblocks the specified user.  Available only for admin.

```
680
PUT /users/:id/unblock
681 682 683 684
```

Parameters:

685
- `id` (required) - id of specified user
686

687 688
Will return `200 OK` on success, `404 User Not Found` is user cannot be found or
`403 Forbidden` when trying to unblock a user blocked by LDAP synchronization.
689 690 691

### Get user contribution events

692
Get the contribution events for the specified user, sorted from newest to oldest.
693 694 695 696 697 698 699 700 701 702 703 704

```
GET /users/:id/events
```

Parameters:

| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | integer | yes | The ID of the user |

```bash
705
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/users/:id/events
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726
```

Example response:

```json
[
  {
    "title": null,
    "project_id": 15,
    "action_name": "closed",
    "target_id": 830,
    "target_type": "Issue",
    "author_id": 1,
    "data": null,
    "target_title": "Public project search field",
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
727
      "web_url": "http://localhost:3000/root"
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743
    },
    "author_username": "root"
  },
  {
    "title": null,
    "project_id": 15,
    "action_name": "opened",
    "target_id": null,
    "target_type": null,
    "author_id": 1,
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
744
      "web_url": "http://localhost:3000/root"
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789
    },
    "author_username": "john",
    "data": {
      "before": "50d4420237a9de7be1304607147aec22e4a14af7",
      "after": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
      "ref": "refs/heads/master",
      "user_id": 1,
      "user_name": "Dmitriy Zaporozhets",
      "repository": {
        "name": "gitlabhq",
        "url": "git@dev.gitlab.org:gitlab/gitlabhq.git",
        "description": "GitLab: self hosted Git management software. \r\nDistributed under the MIT License.",
        "homepage": "https://dev.gitlab.org/gitlab/gitlabhq"
      },
      "commits": [
        {
          "id": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
          "message": "Add simple search to projects in public area",
          "timestamp": "2013-05-13T18:18:08+00:00",
          "url": "https://dev.gitlab.org/gitlab/gitlabhq/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428",
          "author": {
            "name": "Dmitriy Zaporozhets",
            "email": "dmitriy.zaporozhets@gmail.com"
          }
        }
      ],
      "total_commits_count": 1
    },
    "target_title": null
  },
  {
    "title": null,
    "project_id": 15,
    "action_name": "closed",
    "target_id": 840,
    "target_type": "Issue",
    "author_id": 1,
    "data": null,
    "target_title": "Finish & merge Code search PR",
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
790
      "web_url": "http://localhost:3000/root"
791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813
    },
    "author_username": "root"
  },
  {
    "title": null,
    "project_id": 15,
    "action_name": "commented on",
    "target_id": 1312,
    "target_type": "Note",
    "author_id": 1,
    "data": null,
    "target_title": null,
    "created_at": "2015-12-04T10:33:58.089Z",
    "note": {
      "id": 1312,
      "body": "What an awesome day!",
      "attachment": null,
      "author": {
        "name": "Dmitriy Zaporozhets",
        "username": "root",
        "id": 1,
        "state": "active",
        "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
814
        "web_url": "http://localhost:3000/root"
815 816 817 818 819 820 821 822 823 824 825 826 827 828
      },
      "created_at": "2015-12-04T10:33:56.698Z",
      "system": false,
      "upvote": false,
      "downvote": false,
      "noteable_id": 377,
      "noteable_type": "Issue"
    },
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
829
      "web_url": "http://localhost:3000/root"
830 831 832 833 834
    },
    "author_username": "root"
  }
]
```