question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception using People API

See original GitHub issue

The dotnet client does not have any documentation of People API. I am trying to use People API by imitating the documentation of Java samples given here: https://developers.google.com/people/quickstart/java. Here’s what I’ve tried:

        public void Connections()
        {
            // Request 10 connections.
            
            var request = service.People.Connections
                .List("people/me");

            request.PageSize = 10;
            //request.Fields = "names,emailAddresses";
            request.Fields = "names";

            var response = request.Execute();

            // Print display name of connections if available.
            var connections = response.Connections;

            foreach (var connection in connections)
            {
                var names = connection.Names;
                foreach (var name in names)
                {
                    Console.WriteLine($"{name.DisplayName}");
                }
            }
        }

Unfortunately I’m seeing the following exception:

Google.GoogleApiException HResult=0x80131500 Message=Google.Apis.Requests.RequestError Request contains an invalid argument. [400] Errors [ Message[Invalid Parameter] Location[fields - parameter] Reason[invalidParameter] Domain[global] ]

Source=Google.Apis

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9

github_iconTop GitHub Comments

3reactions
riyadparvezcommented, Nov 13, 2017

Now it works. It looks like there are two different nuget packages from Google for People API. To make matter worse the older one comes up top when searched in Visual Studio.

1reaction
jbtulecommented, Apr 16, 2018

Can you unlist the Google.Apis.People.v1 package? https://www.nuget.org/packages/Google.Apis.People.v1/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null reference exception on Person object in Google ...
Closed 2 years ago. I am trying to add a contact to my Google contacts account. This is the code: // Create new...
Read more >
Status | People API
The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is ......
Read more >
Method: people.get | People API
Provides information about a person by specifying a resource name. Use people/me to indicate the authenticated user. The request returns a 400  ......
Read more >
Re: I can't update Google Contact
Person class that I set in several its fields this is the result: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
Read more >
Class: Google::Apis::PeopleV1::PeopleServiceService
Provides information about a list of specific people by specifying a list of requested resource names. Use people/me to indicate the authenticated user....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found