ユーザー: get

認証が必要です

ユーザー ID でユーザーを取得します。 今すぐ試すまたは例を見る

リクエスト

HTTP リクエスト

GET https://www.googleapis.com/blogger/v3/users/userId

パラメータ

パラメータ名 説明
必須パラメータ
userId string 現在のユーザーの数値 ID、または self

承認

このリクエストは、少なくとも次のうち 1 つのスコープでの承認が必要です(認証と承認の詳細をご確認ください)。

スコープ
https://www.googleapis.com/auth/blogger
https://www.googleapis.com/auth/blogger.readonly

リクエスト本文

このメソッドをリクエストの本文に含めないでください。

レスポンス

成功すると、このメソッドはレスポンスの本文でユーザー リソースを返します。

注: このメソッドで使用可能なコード例では、サポートされているプログラミング言語すべての例を示しているわけではありません(サポートされている言語の一覧については、クライアント ライブラリ ページをご覧ください)。

Java

Java クライアント ライブラリを使用します

// Configure the Java API Client for Installed Native App
HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
JsonFactory JSON_FACTORY = new JacksonFactory();

// Configure the Installed App OAuth2 flow.
Credential credential = OAuth2Native.authorize(HTTP_TRANSPORT,
        JSON_FACTORY, new LocalServerReceiver(),
        Arrays.asList(BloggerScopes.BLOGGER));

// Construct the Blogger API access facade object.
Blogger blogger = Blogger.builder(HTTP_TRANSPORT, JSON_FACTORY)
        .setApplicationName("Blogger-UsersGet-Snippet/1.0")
        .setHttpRequestInitializer(credential).build();

// The request action.
Get usersGetAction = blogger.users().get("self");

// Restrict the result content to just the data we need.
usersGetAction
.setFields("displayName,url");

// This step sends the request to the server.
User user = usersGetAction.execute();

// Now we can navigate the response.
System.out.println("Display Name: " + user.getDisplayName());
System.out.println("Profile URL: " + user.getUrl());