|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 2 | + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 | + |
| 4 | +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 5 | +<head> |
| 6 | + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| 7 | + <title>Develop.GitHub - </title> |
| 8 | + <script type="text/javascript" src="../js/jquery-1.2.6.pack.js"></script> |
| 9 | + <script type="text/javascript" src="../js/thickbox-compressed.js"></script> |
| 10 | + <script type="text/javascript" src="../js/jquery.corner.js"></script> |
| 11 | + |
| 12 | + <link rel="stylesheet" href="../css/screen.css" type="text/css" media="screen, projection"> |
| 13 | + <link rel="stylesheet" href="../css/print.css" type="text/css" media="print"> |
| 14 | + <!--[if IE]> |
| 15 | + <link rel="stylesheet" href="../css/ie.css" type="text/css" media="screen, projection"> |
| 16 | + <![endif]--> |
| 17 | + |
| 18 | + <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8"/> |
| 19 | + <link rel="stylesheet" href="../css/thickbox.css" type="text/css" media="screen"/> |
| 20 | +</head> |
| 21 | + |
| 22 | +<body> |
| 23 | + <div class="container"> |
| 24 | + |
| 25 | + <div class="span-21" id="header"> |
| 26 | + <div class="span-10"> |
| 27 | + <a href="/"><img src="../images/develop-github.png" alt="github learn logo" /></a> |
| 28 | + </div> |
| 29 | + |
| 30 | + <div class="span-11 last"> |
| 31 | + <div id="links"> |
| 32 | + <a href="http://github.com">home</a> |
| 33 | + <a href="http://github.com/login">login</a> |
| 34 | + <a href="http://github.com/signup">signup!</a> |
| 35 | + </div> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + |
| 39 | + <div class="span-21 last content"> |
| 40 | + <h2 id='issues_api'>Issues API</h2> |
| 41 | + |
| 42 | +<p>The API for GitHub Issues.</p> |
| 43 | + |
| 44 | +<h3 id='list_a_projects_issues'>List a Projects Issues</h3> |
| 45 | + |
| 46 | +<p>To see a list of issues for a project,</p> |
| 47 | + |
| 48 | +<pre><code>issues/list/:user/:repo/:state</code></pre> |
| 49 | + |
| 50 | +<p>where :state is either ‘open’ or ‘closed’.</p> |
| 51 | + |
| 52 | +<p>For example, to see all the open issues I have on the schacon/simplegit project, we can run</p> |
| 53 | + |
| 54 | +<pre><code>$ curl http://dev.github.com/api/v2/yaml/issues/list/schacon/simplegit/open |
| 55 | +--- |
| 56 | +issues: |
| 57 | +- position: 1.0 |
| 58 | + number: 1 |
| 59 | + votes: 0 |
| 60 | + created_at: 2009-04-17 14:55:33 -07:00 |
| 61 | + body: my sweet, sweet issue |
| 62 | + title: new issue |
| 63 | + updated_at: 2009-04-17 14:55:33 -07:00 |
| 64 | + user: schacon |
| 65 | + state: open |
| 66 | +- position: 2.0 |
| 67 | + number: 2 |
| 68 | + votes: 0 |
| 69 | + created_at: 2009-04-17 15:16:47 -07:00 |
| 70 | + body: the body of a second issue |
| 71 | + title: another issue |
| 72 | + updated_at: 2009-04-17 15:16:47 -07:00 |
| 73 | + user: schacon |
| 74 | + state: open</code></pre> |
| 75 | + |
| 76 | +<h3 id='view_an_issue'>View an Issue</h3> |
| 77 | + |
| 78 | +<p>To get data on an individual issue by number, run</p> |
| 79 | + |
| 80 | +<pre><code>issues/show/:user/:repo/:number</code></pre> |
| 81 | + |
| 82 | +<p>So to get all the data for a issue #1 in our repo, we can run something like this:</p> |
| 83 | + |
| 84 | +<pre><code>$ curl http://github.com/api/v2/yaml/issues/show/schacon/simplegit/1 |
| 85 | +--- |
| 86 | +issue: |
| 87 | + position: 1.0 |
| 88 | + number: 1 |
| 89 | + votes: 0 |
| 90 | + created_at: 2009-04-17 14:55:33 -07:00 |
| 91 | + body: my sweet, sweet issue |
| 92 | + title: new issue |
| 93 | + updated_at: 2009-04-17 14:55:33 -07:00 |
| 94 | + user: schacon |
| 95 | + state: open</code></pre> |
| 96 | + |
| 97 | +<h3 id='search_issues'>Search Issues</h3> |
| 98 | + |
| 99 | +<p>You can search through a projects issues as well with</p> |
| 100 | + |
| 101 | +<pre><code>issues/search/:user/:repo/:state/:q</code></pre> |
| 102 | + |
| 103 | +<h3 id='open_and_close_issues'>Open and Close Issues</h3> |
| 104 | + |
| 105 | +<p>To open a new issue on a project, make a POST to</p> |
| 106 | + |
| 107 | +<pre><code>issues/open/:user/:repo</code></pre> |
| 108 | + |
| 109 | +<p>Where you can provide POST variables:</p> |
| 110 | + |
| 111 | +<pre><code>title |
| 112 | +body</code></pre> |
| 113 | + |
| 114 | +<p>It will return the data for the newly created ticket if it is successful.</p> |
| 115 | + |
| 116 | +<p>To close or reopen an issue, you just need to supply the issue number</p> |
| 117 | + |
| 118 | +<pre><code>issues/close/:user/:repo/:number |
| 119 | + |
| 120 | +issues/reopen/:user/:repo/:number</code></pre> |
| 121 | + |
| 122 | +<h3 id='edit_existing_issues'>Edit Existing Issues</h3> |
| 123 | + |
| 124 | +<p>For the final three calls (edit, label add and label delete) you have to be authorized a collaborator on the project.</p> |
| 125 | + |
| 126 | +<p>To edit an existing issue, you can POST to</p> |
| 127 | + |
| 128 | +<pre><code>issues/edit/:user/:repo/:number</code></pre> |
| 129 | + |
| 130 | +<p>Where you can provide POST variables:</p> |
| 131 | + |
| 132 | +<pre><code>title |
| 133 | +body</code></pre> |
| 134 | + |
| 135 | +<p>This will overwrite the title or body of the issue, if you are authorized member of the project.</p> |
| 136 | + |
| 137 | +<h3 id='add_and_remove_labels'>Add and Remove Labels</h3> |
| 138 | + |
| 139 | +<p>To add a label, run</p> |
| 140 | + |
| 141 | +<pre><code>issues/label/add/:user/:repo/:label/:number</code></pre> |
| 142 | + |
| 143 | +<p>This will return a list of the labels currently on that issue, your new one included. If the label is not yet in the system, it will be created.</p> |
| 144 | + |
| 145 | +<p>To remove a label, run:</p> |
| 146 | + |
| 147 | +<pre><code>issues/label/remove/:user/:repo/:label/:number</code></pre> |
| 148 | + |
| 149 | +<p>Again, it will return a list of the labels currently on the issue.</p><br/><br/><hr/><div class="span-21 last"> </div><hr/> |
| 150 | + </div> |
| 151 | + |
| 152 | + <div id="footer" class="span-21"> |
| 153 | + <div class="info span-12"> |
| 154 | + <div class="links"> |
| 155 | + <a href="http://github.com/blog/148-github-shirts-now-available">T-Shirts</a> | |
| 156 | + <a href="http://github.com/blog">Blog</a> | |
| 157 | + <a href="http://support.github.com/">Support</a> | |
| 158 | + <a href="http://github.com/training">Git Training</a> | |
| 159 | + <a href="http://github.com/contact">Contact</a> | |
| 160 | + <a href="http://groups.google.com/group/github/">Google Group</a> | |
| 161 | + <a href="http://github.wordpress.com">Status</a> |
| 162 | + </div> |
| 163 | + <div class="company"> |
| 164 | + GitHub is <a href="http://logicalawesome.com/">Logical Awesome</a> ©2009 | <a href="http://github.com/site/terms">Terms of Service</a> | <a href="http://github.com/site/privacy">Privacy Policy</a> |
| 165 | + </div> |
| 166 | + </div> |
| 167 | + <div class="fork span-7"> |
| 168 | + This website is <a href="http://github.com/develop/develop.github.com">open source</a>. |
| 169 | + Please help us by forking the project and adding to it. |
| 170 | + </div> |
| 171 | + </div> |
| 172 | + |
| 173 | + </div> |
| 174 | + |
| 175 | + <script type="text/javascript"> |
| 176 | + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
| 177 | + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
| 178 | + </script> |
| 179 | + <script type="text/javascript"> |
| 180 | + var pageTracker = _gat._getTracker("UA-3769691-2"); |
| 181 | + pageTracker._initData(); |
| 182 | + pageTracker._trackPageview(); |
| 183 | + </script> |
| 184 | + |
| 185 | +</body> |
| 186 | +</html> |
0 commit comments