@@ -22,7 +22,7 @@ Let's start by testing our setup. Open up a command prompt and enter the
2222following command:
2323
2424``` command-line
25- $ curl https:// {{ site.data.variables.product.api_url_pre }}/zen
25+ $ curl {{ site.data.variables.product.api_url_pre }}/zen
2626
2727> Keep it logically awesome.
2828```
@@ -33,12 +33,12 @@ Next, let's `GET` [Chris Wanstrath's][defunkt github] [GitHub profile][users api
3333
3434``` command-line
3535# GET /users/defunkt
36- $ curl https:// {{ site.data.variables.product.api_url_pre }}/users/defunkt
36+ $ curl {{ site.data.variables.product.api_url_pre }}/users/defunkt
3737
3838> {
3939> "login": "defunkt",
4040> "id": 2,
41- > "url": "https:// {{ site.data.variables.product.api_url_pre }}/users/defunkt",
41+ > "url": "{{ site.data.variables.product.api_url_pre }}/users/defunkt",
4242> "html_url": "https://github.com/defunkt",
4343> ...
4444> }
@@ -47,7 +47,7 @@ $ curl https://{{ site.data.variables.product.api_url_pre }}/users/defunkt
4747Mmmmm, tastes like [ JSON] [ json ] . Let's add the ` -i ` flag to include headers:
4848
4949``` command-line
50- $ curl -i https:// {{ site.data.variables.product.api_url_pre }}/users/defunkt
50+ $ curl -i {{ site.data.variables.product.api_url_pre }}/users/defunkt
5151
5252> HTTP/1.1 200 OK
5353> Server: GitHub.com
@@ -69,7 +69,7 @@ $ curl -i https://{{ site.data.variables.product.api_url_pre }}/users/defunkt
6969> {
7070> "login": "defunkt",
7171> "id": 2,
72- > "url": "https:// {{ site.data.variables.product.api_url_pre }}/users/defunkt",
72+ > "url": "{{ site.data.variables.product.api_url_pre }}/users/defunkt",
7373> "html_url": "https://github.com/defunkt",
7474> ...
7575> }
@@ -101,7 +101,7 @@ The easiest way to authenticate with the {{ site.data.variables.product.product_
101101username and password via Basic Authentication.
102102
103103``` command-line
104- $ curl -i -u <em>your_username</em> https:// {{ site.data.variables.product.api_url_pre }}/users/defunkt
104+ $ curl -i -u <em>your_username</em> {{ site.data.variables.product.api_url_pre }}/users/defunkt
105105
106106> Enter host password for user <em>your_username</em>:
107107```
@@ -121,7 +121,7 @@ If you have [two-factor authentication][2fa] enabled, the API will return a
121121` 401 Unauthorized ` error code for the above request (and every other API request):
122122
123123``` command-line
124- $ curl -i -u <em>your_username</em> https:// {{ site.data.variables.product.api_url_pre }}/users/defunkt
124+ $ curl -i -u <em>your_username</em> {{ site.data.variables.product.api_url_pre }}/users/defunkt
125125
126126> Enter host password for user <em>your_username</em>:
127127
@@ -145,7 +145,7 @@ associated with your {{ site.data.variables.product.product_name }} account. For
145145[ your own user profile] [ auth user api ] :
146146
147147``` command-line
148- $ curl -i -u <em>your_username</em> https:// {{ site.data.variables.product.api_url_pre }}/user
148+ $ curl -i -u <em>your_username</em> {{ site.data.variables.product.api_url_pre }}/user
149149
150150> {
151151> ...
@@ -196,10 +196,10 @@ to create an OAuth token. Try pasting and running the following command:
196196
197197``` command-line
198198$ curl -i -u <em>your_username</em> -d '{"scopes": ["repo", "user"], "note": "getting-started"}' \
199- $ https:// {{ site.data.variables.product.api_url_pre }}/authorizations
199+ $ {{ site.data.variables.product.api_url_pre }}/authorizations
200200
201201> HTTP/1.1 201 Created
202- > Location: https:// {{ site.data.variables.product.api_url_pre }}/authorizations/2
202+ > Location: {{ site.data.variables.product.api_url_pre }}/authorizations/2
203203> Content-Length: 384
204204
205205> {
@@ -209,7 +209,7 @@ $ https://{{ site.data.variables.product.api_url_pre }}/authorizations
209209> ],
210210> "token": "5199831f4dd3b79e7c5b7e0ebe75d67aa66e79d4",
211211> "updated_at": "2012-11-14T14:04:24Z",
212- > "url": "https:// {{ site.data.variables.product.api_url_pre }}/authorizations/2",
212+ > "url": "{{ site.data.variables.product.api_url_pre }}/authorizations/2",
213213> "app": {
214214> "url": "https://developer.github.com/v3/oauth/#oauth-authorizations-api",
215215> "name": "GitHub API"
@@ -246,7 +246,7 @@ in the [X-GitHub-OTP request header][2fa header]:
246246``` command-line
247247$ curl -i -u <em>your_username</em> -H "X-GitHub-OTP: <em>your_2fa_OTP_code</em>" \
248248 -d '{"scopes": ["repo", "user"], "note": "getting-started"}' \
249- https:// {{ site.data.variables.product.api_url_pre }}/authorizations
249+ {{ site.data.variables.product.api_url_pre }}/authorizations
250250```
251251
252252If you enabled 2FA with a mobile application, go ahead and get an OTP code from
@@ -259,7 +259,7 @@ in the rest of our examples. Let's grab our own user info again, using OAuth thi
259259
260260``` command-line
261261$ curl -i -H 'Authorization: token 5199831f4dd3b79e7c5b7e0ebe75d67aa66e79d4' \
262- https:// {{ site.data.variables.product.api_url_pre }}/user
262+ {{ site.data.variables.product.api_url_pre }}/user
263263```
264264
265265** Treat OAuth tokens like passwords!** Don't share them with other users or store
@@ -276,26 +276,26 @@ information. We can [`GET` repository details][get repo] in the same way we fetc
276276details earlier:
277277
278278``` command-line
279- $ curl -i https:// {{ site.data.variables.product.api_url_pre }}/repos/twbs/bootstrap
279+ $ curl -i {{ site.data.variables.product.api_url_pre }}/repos/twbs/bootstrap
280280```
281281
282282In the same way, we can [ view repositories for the authenticated user] [ user repos api ] :
283283
284284``` command-line
285285$ curl -i -H 'Authorization: token 5199831f4dd3b79e7c5b7e0ebe75d67aa66e79d4' \
286- https:// {{ site.data.variables.product.api_url_pre }}/user/repos
286+ {{ site.data.variables.product.api_url_pre }}/user/repos
287287```
288288
289289Or, we can [ list repositories for another user] [ other user repos api ] :
290290
291291``` command-line
292- $ curl -i https:// {{ site.data.variables.product.api_url_pre }}/users/technoweenie/repos
292+ $ curl -i {{ site.data.variables.product.api_url_pre }}/users/technoweenie/repos
293293```
294294
295295Or, we can [ list repositories for an organization] [ org repos api ] :
296296
297297``` command-line
298- $ curl -i https:// {{ site.data.variables.product.api_url_pre }}/orgs/mozilla/repos
298+ $ curl -i {{ site.data.variables.product.api_url_pre }}/orgs/mozilla/repos
299299```
300300
301301The information returned from these calls will depend on how we authenticate:
@@ -311,7 +311,7 @@ for the repository. In this way, we can fetch only directly-owned repositories,
311311organization repositories, or repositories the user collaborates on via a team.
312312
313313``` command-line
314- $ curl -i "https:// {{ site.data.variables.product.api_url_pre }}/users/technoweenie/repos?type=owner"
314+ $ curl -i "{{ site.data.variables.product.api_url_pre }}/users/technoweenie/repos?type=owner"
315315```
316316
317317In this example, we grab only those repositories that technoweenie owns, not the
@@ -333,7 +333,7 @@ $ curl -i -H 'Authorization: token 5199831f4dd3b79e7c5b7e0ebe75d67aa66e79d4' \
333333 "private": true, \
334334 "gitignore_template": "nanoc" \
335335 }' \
336- https:// {{ site.data.variables.product.api_url_pre }}/user/repos
336+ {{ site.data.variables.product.api_url_pre }}/user/repos
337337```
338338
339339In this minimal example, we create a new repository for our blog (to be served
@@ -348,7 +348,7 @@ an owner, just change the API method from `/user/repos` to `/orgs/<org_name>/rep
348348Next, let's fetch our newly created repository:
349349
350350``` command-line
351- $ curl -i https:// {{ site.data.variables.product.api_url_pre }}/repos/pengwynn/blog
351+ $ curl -i {{ site.data.variables.product.api_url_pre }}/repos/pengwynn/blog
352352
353353> HTTP/1.1 404 Not Found
354354
@@ -375,21 +375,21 @@ authenticated user. To [see all your issues][get issues api], call `GET /issues`
375375
376376``` command-line
377377$ curl -i -H 'Authorization: token 5199831f4dd3b79e7c5b7e0ebe75d67aa66e79d4' \
378- https:// {{ site.data.variables.product.api_url_pre }}/issues
378+ {{ site.data.variables.product.api_url_pre }}/issues
379379```
380380
381381To get only the [ issues under one of your {{ site.data.variables.product.product_name }} organizations] [ get issues api ] , call `GET
382382/orgs/<org >/issues`:
383383
384384``` command-line
385385$ curl -i -H 'Authorization: token 5199831f4dd3b79e7c5b7e0ebe75d67aa66e79d4' \
386- https:// {{ site.data.variables.product.api_url_pre }}/orgs/rails/issues
386+ {{ site.data.variables.product.api_url_pre }}/orgs/rails/issues
387387```
388388
389389We can also get [ all the issues under a single repository] [ repo issues api ] :
390390
391391``` command-line
392- $ curl -i https:// {{ site.data.variables.product.api_url_pre }}/repos/rails/rails/issues
392+ $ curl -i {{ site.data.variables.product.api_url_pre }}/repos/rails/rails/issues
393393```
394394
395395### Pagination
@@ -399,12 +399,12 @@ making multiple API calls to get the data. Let's repeat that last call, this
399399time taking note of the response headers:
400400
401401``` command-line
402- $ curl -i https:// {{ site.data.variables.product.api_url_pre }}/repos/rails/rails/issues
402+ $ curl -i {{ site.data.variables.product.api_url_pre }}/repos/rails/rails/issues
403403
404404> HTTP/1.1 200 OK
405405
406406> ...
407- > Link: <https:// {{ site.data.variables.product.api_url_pre }}/repositories/8514/issues?page=2>; rel="next", <https:// {{ site.data.variables.product.api_url_pre }}/repositories/8514/issues?page=30>; rel="last"
407+ > Link: <{{ site.data.variables.product.api_url_pre }}/repositories/8514/issues?page=2>; rel="next", <{{ site.data.variables.product.api_url_pre }}/repositories/8514/issues?page=30>; rel="last"
408408> ...
409409```
410410
@@ -430,10 +430,10 @@ $ "title": "New logo", \
430430$ "body": "We should have one", \
431431$ "labels": ["design"] \
432432$ }' \
433- $ https:// {{ site.data.variables.product.api_url_pre }}/repos/pengwynn/api-sandbox/issues
433+ $ {{ site.data.variables.product.api_url_pre }}/repos/pengwynn/api-sandbox/issues
434434
435435> HTTP/1.1 201 Created
436- > Location: https:// {{ site.data.variables.product.api_url_pre }}/repos/pengwynn/api-sandbox/issues/17
436+ > Location: {{ site.data.variables.product.api_url_pre }}/repos/pengwynn/api-sandbox/issues/17
437437> X-RateLimit-Limit: 5000
438438
439439> {
@@ -452,7 +452,7 @@ $ https://{{ site.data.variables.product.api_url_pre }}/repos/pengwynn/api-sa
452452> "gravatar_id": "7e19cd5486b5d6dc1ef90e671ba52ae0",
453453> "avatar_url": "https://secure.gravatar.com/avatar/7e19cd5486b5d6dc1ef90e671ba52ae0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
454454> "id": 865,
455- > "url": "https:// {{ site.data.variables.product.api_url_pre }}/users/pengwynn"
455+ > "url": "{{ site.data.variables.product.api_url_pre }}/users/pengwynn"
456456> },
457457> "closed_at": null,
458458> "updated_at": "2012-11-14T15:25:33Z",
@@ -463,13 +463,13 @@ $ https://{{ site.data.variables.product.api_url_pre }}/repos/pengwynn/api-sa
463463> {
464464> "color": "ededed",
465465> "name": "design",
466- > "url": "https:// {{ site.data.variables.product.api_url_pre }}/repos/pengwynn/api-sandbox/labels/design"
466+ > "url": "{{ site.data.variables.product.api_url_pre }}/repos/pengwynn/api-sandbox/labels/design"
467467> }
468468> ],
469469> "id": 8356941,
470470> "assignee": null,
471471> "state": "open",
472- > "url": "https:// {{ site.data.variables.product.api_url_pre }}/repos/pengwynn/api-sandbox/issues/17"
472+ > "url": "{{ site.data.variables.product.api_url_pre }}/repos/pengwynn/api-sandbox/issues/17"
473473> }
474474```
475475
@@ -484,7 +484,7 @@ requests][conditional-requests] and helps you do the right thing. Consider the
484484first call we made to get defunkt's profile:
485485
486486``` command-line
487- $ curl -i https:// {{ site.data.variables.product.api_url_pre }}/users/defunkt
487+ $ curl -i {{ site.data.variables.product.api_url_pre }}/users/defunkt
488488
489489> HTTP/1.1 200 OK
490490> ETag: "bfd85cbf23ac0b0c8a29bee02e7117c6"
@@ -497,7 +497,7 @@ we can tell the API to give us the resource again, only if it has changed:
497497
498498``` command-line
499499$ curl -i -H 'If-None-Match: "bfd85cbf23ac0b0c8a29bee02e7117c6"' \
500- $ https:// {{ site.data.variables.product.api_url_pre }}/users/defunkt
500+ $ {{ site.data.variables.product.api_url_pre }}/users/defunkt
501501
502502> HTTP/1.1 304 Not Modified
503503```
0 commit comments