Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. {
  2. "error": {
  3. "errors": [{
  4. "domain": "global",
  5. "reason": "authError",
  6. "message": "Invalid Credentials",
  7. "locationType": "header",
  8. "location": "Authorization"
  9. }],
  10. "code": 401,
  11. "message": "Invalid Credentials"
  12. }
  13. }
  14.  
  15. curl -H "Authorization: OAuth ya29.xyzxyz" "https://www.googleapis.com/plus/v1/people/me"
  16.  
  17. $oauth = new OAuth($this->config->consumer_key, $this->config->consumer_secret, $this->config->signature_method, $this->config->auth_type);
  18. $oauth->setVersion($this->config->version);
  19. $oauth->setToken($accessToken->oauth_token, $accessToken->oauth_token_secret);
  20.  
  21. $params = array(
  22. 'fields' => 'displayName,emails,id,image,name',
  23. 'pp' => 1
  24. );
  25.  
  26. $oauth->fetch('https://www.googleapis.com/plus/v1/people/me', $params, OAUTH_HTTP_METHOD_GET);
  27.  
  28. // extract response
  29. $json = Zend_Json::decode($oauth->getLastResponse(), Zend_Json::TYPE_OBJECT);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement