Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Fix confusing about missing "plan" field of user data due to missing "user" scope#630

Closed
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletionscontent/guides/getting-started.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -196,16 +196,19 @@ Also, the [**Authorizations API**][authorizations api] makes it simple to use Ba
to create an OAuth token. Try pasting and running the following command:

<pre class="terminal">
$ curl -i -u &lt;your_username&gt; -d '{"scopes": ["repo"], "note": "getting-started"}' \
https://api.github.com/authorizations
$ curl -i -u &lt;your_username&gt; -d '{"scopes": ["repo", "public_repo", "user", "gist"], \
"note": "getting-started"}' https://api.github.com/authorizations

HTTP/1.1 201 Created
Location: https://api.github.com/authorizations/2
Content-Length: 384

{
"scopes": [
"repo"
"repo",
"public_repo",
"user",
"gist"
],
"token": "5199831f4dd3b79e7c5b7e0ebe75d67aa66e79d4",
"updated_at": "2012-11-14T14:04:24Z",
Expand All@@ -230,7 +233,9 @@ Next, let's look at the `scopes` we're sending over in this call. When creating
a new token, we include an optional array of [_scopes_][scopes], or access
levels, that indicate what information this token can access. In this case,
we're setting up the token with _repo_ access, which grants access to read and
write to private repositories. See [the scopes docs][scopes] for a full list of
write to private repositories, _public\_repo_ grants access to read and write to
public repositories, _user_ grants access to read and write to all user data, and
_gist_ grants access to create new gists. See [the scopes docs][scopes] for a full list of
scopes. You should **only** request scopes that your application actually needs,
in order to not frighten users with potentially invasive actions. The `201`
status code tells us that the call was successful, and the JSON returned
Expand All@@ -243,8 +248,8 @@ in the [X-GitHub-OTP request header][2fa header]:

<pre class="terminal">
$ curl -i -u &lt;your_username&gt; -H "X-GitHub-OTP: &lt;your_2fa_OTP_code&gt;" \
-d '{"scopes": ["repo"], "note": "getting-started"}' \
https://api.github.com/authorizations
-d '{"scopes": ["repo", "public_repo", "user", "gist"], \
"note": "getting-started"}'https://api.github.com/authorizations
</pre>

If you enabled 2FA with a mobile application, go ahead and get an OTP code from
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp