Google Cloud Print API: User account required
I am trying to use the Google Cloud Print library to get a list of cloud printers available to users, but when I make a request I get the error: "Required user credentials"
This is how I send the request:
var request = require('request');
var options = {
url: 'https://www.google.com/cloudprint/search',
headers: {
'X-CloudPrint-Proxy': 'APP_NAME',
'Authorization': 'GoogleLogin auth=ACCESS_TOKEN_HERE'
}
};
function callback(err, response, body) {
console.log(err);
console.log(response);
console.log(body);
}
request(options, callback);
+3
source to share
2 answers
To make this work (as there is no exact documentation).
Add https://www.googleapis.com/auth/cloudprint to the login scope.
+3
source to share
If you look here: https://github.com/dpsm/android-print/blob/master/src/main/java/com/github/dpsm/android/print/GoogleCloudPrint.java
They want authorization to be Media ACCESS_TOKEN_HERE
instead of GoogleLogin auth = ACCESS_TOKEN_HERE
+1
source to share