Bhavesh Nariya
Bhavesh Nariya

Reputation: 365

Retrieving list of Google+ comunity activites

I am using the google+ api to retrieve a list of community posts.

$data = file_get_contents('https://www.googleapis.com/plus/v1/people/111449227367642341024/activities/public?key={YOUR_API_KEY}');
$response = json_decode($data, true);
echo '<pre>';
print_r($response); 

But it throws error like

Failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden

I have also passed api-key but still not working.

Upvotes: 0

Views: 64

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116868

Possible problem number one:

Activities: list

List all of the activities in the specified collection for a particular user.

Note: 111449227367642341024 does not appear to be a valid Google+ user id so that doesn't work I am going to assume that you changed it

Possible problem number two:

The code you have posted does not contain an API key you say you have passed it.

GET https://www.googleapis.com/plus/v1/people/111449227367642341024/activities/public?key={YOUR_API_KEY}

Possible problem number three:

Also make sure that you have the Google+ API enabled in google developers console.

Upvotes: 1

Related Questions