|
| 1 | +--- |
| 2 | +title:Reactions API Preview now includes user information |
| 3 | +author_name:kneemer |
| 4 | +--- |
| 5 | + |
| 6 | +To avoid making extra API calls, we've updated the[Reactions API preview][initial-reaction-api-post] to include additional user information when listing Reactions. |
| 7 | + |
| 8 | +**This is a breaking change for Reaction payloads**. If you're trying out this new API during its preview period, you'll need to update your code to continue working with it. |
| 9 | + |
| 10 | +##JSON Payload Changes |
| 11 | + |
| 12 | +We're replacing the`user_id` attribute with`user` and changing the schema type from a number to a JSON object. |
| 13 | + |
| 14 | +##Example Reaction JSON |
| 15 | +```json |
| 16 | +[ |
| 17 | + { |
| 18 | +"id":1, |
| 19 | +"user": { |
| 20 | +"login":"octocat", |
| 21 | +"id":1, |
| 22 | +"avatar_url":"https://github.com/images/error/octocat_happy.gif", |
| 23 | +"gravatar_id":"", |
| 24 | +"url":"https://api.github.com/users/octocat", |
| 25 | +"html_url":"https://github.com/octocat", |
| 26 | +"followers_url":"https://api.github.com/users/octocat/followers", |
| 27 | +"following_url":"https://api.github.com/users/octocat/following{/other_user}", |
| 28 | +"gists_url":"https://api.github.com/users/octocat/gists{/gist_id}", |
| 29 | +"starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}", |
| 30 | +"subscriptions_url":"https://api.github.com/users/octocat/subscriptions", |
| 31 | +"organizations_url":"https://api.github.com/users/octocat/orgs", |
| 32 | +"repos_url":"https://api.github.com/users/octocat/repos", |
| 33 | +"events_url":"https://api.github.com/users/octocat/events{/privacy}", |
| 34 | +"received_events_url":"https://api.github.com/users/octocat/received_events", |
| 35 | +"type":"User", |
| 36 | +"site_admin":false |
| 37 | + }, |
| 38 | +"content":"heart" |
| 39 | + } |
| 40 | +] |
| 41 | +``` |
| 42 | + |
| 43 | +As always, if you have any questions or feedback, please[get in touch][contact]. |
| 44 | + |
| 45 | +[initial-reaction-api-post]:/changes/2016-05-12-reactions-api-preview |
| 46 | +[contact]:https://github.com/contact?form%5Bsubject%5D=Reactions+API+Preview |