Google+ API plus.me

后端 未结 4 1659
臣服心动
臣服心动 2021-01-06 07:04

The question: How to use people.get with the \"me\" parameter?

I know how to get the json object when using https://www.googleapis.com/plus/v1/people/{id}?key=

相关标签:
4条回答
  • 2021-01-06 07:06

    You can use me ID as long as you access the app with the access token of an (OAuth) authenticated user. To quote from the G+ API documentation:

    If using the userId value "me", this method requires authentication using a token that has been granted the OAuth scope https://www.googleapis.com/auth/plus.me. Read more about using OAuth.

    Example: when using the PHP API client, before issuing e.g.

    $plus_api = new apiPlusService($client); // $client is the apiClient() object
    $plus_api->activities->listActivities('me', ...);
    

    you have to set the access token of the authenticated user first by executing:

    $client->setAccessToken($access_token);
    

    With that set, the me ID will be recognized without a problem.

    0 讨论(0)
  • 2021-01-06 07:12

    We have developed a .NET client library for Google+ APIs. This library makes it very easy to use Google+ APIs from any .NET programming languages like C#, VB.NET or ASP.NET

    You can find more details about the .NET library for Google+ here: http://www.googleplustips.com/resources/3332-NET-Library-Google-APIs-released.aspx

    The current version supports all Google+ APIs version 1, and works with API Key. Calling any Google APIs require only a single method call.

    0 讨论(0)
  • 2021-01-06 07:26

    GetActivity and ListComments are getting all the data, or it has some method(using nextPageToken) to get all the items?

    Each method call returns the resultset page by page. The returned object has a property called NextPageToken which can be passed with the next call to retrieve the next page of the result set.

    0 讨论(0)
  • 2021-01-06 07:32

    I sent a POST request (info here) to get the Oauth2 access_token and used:

    https://www.googleapis.com/plus/v1/people/me?key={key}&access_token={token}

    0 讨论(0)
提交回复
热议问题