Ways to retrieve the number of individuals using the Google Plus API

I am using these scopes for registration:

var scopes = '://www.googleapis.com/auth/plus.login ://www.googleapis.com/auth/plus.me ://www.googleapis.com/auth/plus.profile.emails.read ://www.googleapis.com/auth/plus.circles.read';

This code is used to get a list and count of users:

  var request = gapi.client.plus.people.list({
                    'userId': 'me',
                    'collection': 'visible'
                });
 if (resp.totalItems)
       result.friends = resp.totalItems;

The result of this script is:

etag:""FT7X6cYw9BSnPtIywEFNNGVVdio/ObDqMibaPxXUs7wb-vH72G2zQbI""
items:[]
kind:"plus#peopleFeed"
title:"Google+ List of Visible People"
totalItems:0

Where did I go wrong?

Answer №1

No wrongdoing on your part. It's likely that the user in question simply doesn't have anyone else within their circles using your application.

Here are the acceptable values:
- "connected": This includes visible individuals within the authenticated user's circles who also use the requesting app, limited to those who have made their app activities visible to said user.
- "visible": This encompasses people added by the user to one or more circles, but restricted to the circles visible to the requesting application.

The "visible" category consists of individuals in the authenticated user's circles who are also utilizing your application.

It’s important to note that as per the current Google+ API, it is not possible to retrieve a list of friends or individuals in circles of an authenticated user. There is no other publicly accessible API that provides this information. The only available option is to identify users who have authorized the same application and are connected. Unfortunately, the capabilities of the Google+ API are quite constrained.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Angularjs changes the "&" character to "&"

Here is the AngularJS code I am using: $scope.getEventSeconds = function(){ $http.get('myfile.php', { params: { 'action': 'get_datas' } }).success(function(data){ $scope.list = data; $scop ...

How can I make the divs resize automatically and have them equal in height when the window is resized?

I need to adjust the height of three column divs so that they are all equal. Initially, I was able to achieve this using a function found on SO (apologies for not being able to provide attribution at this time, will update if possible): function resizeIt( ...

How to initiate a countdown timer on a server and execute an event once the timer reaches zero

I am currently working on a website that will host contests. When a moderator starts a test, a countdown timer will begin. Once the countdown finishes, an "Exam" event will launch. After the test time elapses, the page will automatically refresh to displ ...

A URL that quickly updates live content from a backend script

As a beginner, I am seeking guidance as to where to start on my journey of learning. I need assistance in creating a script that can efficiently fit within a small URI space and constantly updates itself with information from a server script. My target bro ...

Tips for refreshing a texture in ThreeJS using imported image information?

Does anyone know the most efficient method to update a texture in threejs using data from an image? I've tried loadTexture, but it creates a new texture each time and I am struggling to figure out how to pass on an image object. I have already create ...

Ways to combine extensive value within an array containing various objects

I am working with an array of objects and I need to merge all the values of params within each object into a single object. Array [ Object { "key": "This week", "params": Object { "thisWeekfilterDistance": [Function anonymous], "this ...

Connecting Checkboxes and Chips Together in Vue js (Bi-Directional Binding)

Hey there, I'm new to using Vue Js and I'm facing an issue with selecting a dropdown option from a form. The options are displayed as checkboxes within a div, and when a checkbox is selected, a chip should appear with the label of the checkbox. H ...

Exploring Shader Materials and OpenGL Framebuffers within the realm of THREE.js

In my current project, I am attempting to utilize an FBO within a material in THREE.js. The project involves a GPU-based fluid simulation that generates its final visualization to a framebuffer object, which I intend to use as a texture for a mesh. Below i ...

Encountering a CORS issue while using @react-google-maps/api

I encountered a CORS error while using the onClick function. The static markers are set up on page load and not added dynamically. They render correctly, but when I click on the markers, I receive a CORS error pointing to the setSelected line. Any ideas on ...

Using jQuery's Ajax function to specify a dataUrl before sending the request

There seems to be an issue with this AJAX request. The 64-Value-String is not being returned in the beforeSend handler, but it does show up in an alert. I am unsure how to handle this asynchronously. Can someone help me troubleshoot? $imageMaps[0] = &apos ...

What steps can be taken to resolve the error message 'TypeError: Failed to fetch'?

Encountering a TypeError: Failed to fetch error while making a post request using fetch on the front-end and an express route on the back-end. The issue arises when trying to retrieve new user data via the fetch promise after successfully creating a user ...

Is `activeClassName` not being recognized by React?

I've been trying to figure out what's wrong with this code, but I can't seem to find a solution anywhere online. Can someone please help me? This code works fine in my other application, so I'm not sure why it's causing issues here ...

Steer clear of making changes to a JavaScript array

Here is my code snippet: let traces = { ref: null, min: null, max: null, avg: null }; let learning = { "Application": "b3", "t": [ { "d": 2, "BinaryType": "Current" }, { "d": 3, ...

Preparing my FoodApp API database with Faker requires using either import or require in separate files - cannot use both in one

I'm attempting to use the Faker npm package to populate my new database with test data in order to properly evaluate my filters. The problem arises when I try to combine both require and import in the same application. While all of my other packages r ...

Disable the scroll bar on a bootstrap modal

<span class="education"style="font-size:170%;line-height:150%;">&nbsp;Education <br> <small style=" color:gray;font-size:60%;">&nbsp; Blue Ridge University,2012-2014 </small> <br> <sma ...

Storing the result of parsing JSON data into a global variable

$(function() { var countFromData = 0; getReminder(); alert(countFromData); }); function getReminder() { $.getJSON("<?=base_url()?>home/leavereminder", {}, function(data) { ...

Tips for retrieving keycodes/key/which values for DOMSubtreeModified Event

Searching for the keycode pertaining to the DOMSubtreeModified event, but encountering undefined results <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> $(document).ready(function(){ ...

Issue with uploading files in headless mode using Webdriverio V9

After upgrading from v8 to v9, I encountered an issue with file uploads in headless mode. The code worked fine in non-headless mode, but failed in headless mode. I would appreciate any assistance with this. capabilities: [ { maxInst ...

Methods to Maintain Consistent HTML Table Dimensions utilizing DOM

I am facing an issue with shuffling a table that contains images. The table has 4 columns and 2 rows. To shuffle the table, I use the following code: function sortTable() { // Conveniently getting the parent table let table = document.getElementById("i ...

JavaScript Date() constructor failing to capture the correct day

Currently, I am in the process of developing an API that allows users to request transactions based on a specific year and month. This is how the API is structured: routes.get('/transactions/:member_id/:year/:month', (req, res) => { let { ...