Skip to content

Commit 26ed449

Browse files
committed
Added events endpoint
1 parent 46ab53a commit 26ed449

File tree

1 file changed

+70
-7
lines changed

1 file changed

+70
-7
lines changed

README.md

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This document outlines the setup and usage of ZenHub's public API: a RESTful API
66
- [Authentication](#authentication)
77
- [Endpoints](#endpoints)
88
- [Get issue data](#get-issue-data)
9+
- [Get issue events](#get-issue-events)
910
- [Get the ZenHub Board data for a repository](#get-the-zenhub-board-data-for-a-repository)
1011
- [API limits](#api-limits)
1112
- [Errors](#errors)
@@ -26,16 +27,14 @@ The token is sent in the `X-Authentication-Token` header. For example, using `cu
2627
GET https://api.zenhub.io/p1/repositories/:repo_id/issues/:issue_number
2728
```
2829

29-
Remember, the `repo_id` is the ID of the repository, not the full name. For example, the ID of the `ZenHubIO/support` repository is `13550592`.
30-
You can use [GitHub's API](https://developer.github.com/v3/repos/#get) to find out the ID of your repository.
30+
Please note: `repo_id` is the ID of the repository, not its full name. For example, the ID of the `ZenHubIO/support` repository is `13550592`.
31+
To find out the ID of your repository, use [GitHub's API](https://developer.github.com/v3/repos/#get).
3132

32-
The issue number is the same as displayed in your GitHub Issues page.
33+
Issue number is the same as displayed in your GitHub Issues page. For example, to fetch the [Zenhub Public API](https://github.com/ZenHubIO/support/issues/172) issue information, the URL would be `https://api.zenhub.io/p1/repositories/13550592/issues/172`.
3334

34-
For example, to fetch the [Zenhub Public API](https://github.com/ZenHubIO/support/issues/172) issue information, the URL would be `https://api.zenhub.io/p1/repositories/13550592/issues/172`.
35+
The endpoint returns that issue's assigned _Time Estimate_ (if applicable), its _Pipeline_ in the Board, as well as any _+1s_.
3536

36-
The endpoint returns that issue's assigned _Time Estimate_, the _Pipeline_ where it sits in the Board, as well as any _+1s_.
37-
38-
This is an example of returned JSON data:
37+
Here is an example of returned JSON data:
3938
```json
4039
{
4140
"estimate": {
@@ -53,6 +52,70 @@ This is an example of returned JSON data:
5352
}
5453
```
5554

55+
### Get issue events
56+
57+
```
58+
GET https://api.zenhub.io/p1/repositories/:repo_id/issues/:issue_number/events
59+
```
60+
61+
Please note: `repo_id` is the ID of the repository, not its full name. For example, the ID of the `ZenHubIO/support` repository is `13550592`.
62+
To find out the ID of your repository, use [GitHub's API](https://developer.github.com/v3/repos/#get).
63+
64+
Issue number is the same as displayed in your GitHub Issues page. For example, to fetch the [Zenhub Public API](https://github.com/ZenHubIO/support/issues/172) issue information, the URL would be `https://api.zenhub.io/p1/repositories/13550592/issues/172`.
65+
66+
The endpoint returns that issue's events, sorted by most recent. Each event contains the _User ID_ of the person who performed the change, the _Creation Date_ of the event, and _Type_. Type can be either `estimateIssue` or `transferIssue`. Old and new values are included for both event types.
67+
68+
Here is an example of returned JSON data:
69+
```json
70+
[
71+
{
72+
"user_id": 16717,
73+
"type": "estimateIssue",
74+
"created_at": "2015-12-11T19:43:22.296Z",
75+
"from_estimate": {
76+
"value": 8
77+
}
78+
},
79+
{
80+
"user_id": 16717,
81+
"type": "estimateIssue",
82+
"created_at": "2015-12-11T18:43:22.296Z",
83+
"from_estimate": {
84+
"value": 4
85+
},
86+
"to_estimate": {
87+
"value": 8
88+
}
89+
},
90+
{
91+
"user_id": 16717,
92+
"type": "estimateIssue",
93+
"created_at": "2015-12-11T13:43:22.296Z",
94+
"to_estimate": {
95+
"value": 4
96+
}
97+
},
98+
{
99+
"user_id": 16717,
100+
"type": "transferIssue",
101+
"created_at": "2015-12-11T12:43:22.296Z",
102+
"from_pipeline": {
103+
"name": "Backlog"
104+
},
105+
"to_pipeline": {
106+
"name": "In progress"
107+
}
108+
},
109+
{
110+
"user_id": 16717,
111+
"type": "transferIssue",
112+
"created_at": "2015-12-11T11:43:22.296Z",
113+
"to_pipeline": {
114+
"name": "Backlog"
115+
}
116+
}
117+
]
118+
```
56119

57120
### Get the ZenHub Board data for a repository
58121

0 commit comments

Comments
 (0)