Q:

How can i set 'personFields' query parameter in Google People API get request?

  var xhttp = new XMLHttpRequest();
  var theUrl = "https://people.googleapis.com/v1/people/c3591871730916654475?personFields='names,photos,coverPhotos'";
  xhttp.open("GET", theUrl, true);
  xhttp.setRequestHeader('Authorization', 'Bearer ' + currentSessionAccessToken)
  xhttp.onload = function(){
    if(xhttp.status == 200){
        var profileJson = JSON.parse(xhttp.response);
        resolve(profileJson);     
    }
    else{
        if(xhttp.status == 404){
          resolve('No_RESULT_FOUND');
        }
        else{
        reject(xhttp.statusText);
      }
    }
  };
  xhttp.onerror = function(){
    reject(xhttp.statusText);
  };
  xhttp.send();

Above is my XMLHttpRequest. After the request i get an error below:
"{
  "error": {
    "code": 400,
    "message": "Invalid personFields mask path: \"\"names\". Valid paths are documented at https://developers.google.com/people/api/rest/v1/people/get.",
    "status": "INVALID_ARGUMENT"
  }
}
"
Can some one suggest me a valid path? I did not find in the documentation.

A:

Change personFields='names,photos,coverPhotos' to personFields=names,photos,coverPhotos without the '.

