API

Several big providers offer an API to interact with their service.
The Documentation for these API’s Is soooo poor it’s untrue! AWS Are bad, google are a very close second.

developers.google.com

$connections = $people_service->people_connections->listPeopleConnections('people/me', array(
'personFields' => 'names,emailAddresses'));

I have…

$service = new \Google_Service_People($client);
var_dump($service->people_connections->listPeopleConnections('people/me', array(
'personFields' => 'names,emailAddresses')));

When personFields is included…

[2017-08-03 14:31:23] google-api-php-client.ERROR: Service parameter unknown {"service":"people","resource":"connections","method":"list","parameter":"personFields"} []
======================================================================
   The application has thrown an exception!
======================================================================
 Google_Exception
 (list) unknown parameter: 'personFields'
----------------------------------------------------------------------

When personFields is commented out.

 Google_Service_Exception
 {
  "error": {
    "code": 400,
    "message": "personFields mask is required. Please specify one or more valid paths. Valid paths are documented at https://developers.google.com/people/api/rest/v1/people/get.",
    "errors": [
      {
        "message": "personFields mask is required. Please specify one or more valid paths. Valid paths are documented at https://developers.google.com/people/api/rest/v1/people/get.",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT"
  }
}

Published by

Daniel McMorrow

40 Year old disabled geek,

%d bloggers like this: