Google Drive SDK JavaScript 404 Error - javascript

We are getting since yesterday an error each time we try to execute any Drive Method from Javascript Library, such as:
gapi.client.drive.files.get({'fileId': RootFolderID});
gapi.client.drive.children.list({'folderId' : FolderGUID, 'q': 'trashed = ' + trashed});
Or any other.
When we execute this code code:
var RootFolderID = "0Bz9GhmOJPXaDMmlnc1UtNmFKb28";
var GetFileInfo = gapi.client.drive.files.get({'fileId': RootFolderID});
GetFileInfo.execute(function(GetFileInfoResp){
log("RootFolderID", RootFolderID);
log("GetFileInfoResp", GetFileInfoResp);
});
We get the following error
RootFolderID - 0Bz9GhmOJPXaDMmlnc1UtNmFKb28
GetFileInfoResp- Object {code: 404, message: "Not Found", data: Array[1], error: Object}
code: 404
data: Array[1]
error: Object
message: "Not Found"
proto: Object
Two days ago the same code was working fine.
Anyone has the same problem? do you have any clue?
When we try to execute the same method from the Drive SDK help, it works.

We have the same problem. Please vote for the issues 136 & 137 https://code.google.com/p/google-api-javascript-client/issues/list

Sergey Pisarenko spisarenko#google.com
12:41 wrote...
to google-appengi., google-cloud-s., gce-operations
Google API JavaScript client functionality has already been restored for some users, and we expect a resolution for all users in the near future. Please note this time frame is an estimate and may change. Further information for customers with a support contract will also be available in the Google Enterprise Support Center. We will provide an update by 12:30 GMT.

the issue has been solved by Google.
It seems they did a wrong udpate of libraries.
They have rollback the libraries and now it's working fine again.
Thanks and regards,
Fernando.

Related

JavaScript runtime error: [Messenger] Required property 'target' was not provided occurred

I am using the Developers API with an App I created in LinkedIn.
When I call this method to sign in.....
IN.UI.Authorize().params({ "scope": ["r_liteprofile", "r_emailaddress"] }).place()
a Window begins to open and I get this error message:
Unhandled exception at line 7, column 56783 in
http://platform.linkedin.com/in.js 0x800a139e - JavaScript runtime
error: [Messenger] Required property 'target' was not provided
occurred
I have completed LinkedIn's App Setup, but can't figure what could be causing this. My JavaScript code is below:
[script type="text/javascript" src="//platform.linkedin.com/in.js"]
api_key: 'xxxxx......xxxxx'
authorize: true
[/script]
function LinkedInSignIn() {
IN.UI.Authorize().params({ "scope": ["r_liteprofile", "r_emailaddress"] }).place();
IN.Event.on(IN, 'auth', getProfileData);
}
function getProfileData() { // Use the API call wrapper to request the member's basic profile data
IN.API.Profile("me").fields("id,firstName,lastName,email-address,picture-urls::(original),public-profile-url,location:(name)").result(function (me) {
var profile = me.values[0];
var id = profile.id;
alert(profile.firstName);
});
}
As it turned out, the reason this is not working is becuase LinkedIn discontinued it at the end of 2018. Contacting LinkIn's support wasn't much help either. They only said they do no support thier code library and referred my back here to StackOverflow.
For anyone having the same problem, the solutions is to use Oauth2, which is documented at:
https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/context
Happy Coding!
Graham

Parse.com Javascript SDK using include, but not working

I'm trying to fetch data from a table called Book. Inside Book there's a Pointer<ParseUser> which holds the pointer of one user. The ParseUser has another pointer called Pais (which means Country in spanish). So I want to fetch every single info from any Book:
var query = new Parse.Query("Book");
query.include("user");
query.include("user.pais");
query.find({
success: function(books) {
response.success(books);
},
error: function(error) {
response.error({'resp': error.code, 'message': error.message});
}
});
and I don't get the objects, just the pointers:
Why ? I know it works ok when I call it in iOS or Android with include(String key) or includeKey: NSString* key.
Why doesn't it work with Javascript??
Thank you in advance.
Regards.
Rafael.
EDIT:
Oh and I just forgot... I've tried with:
query.include(["user"]);
and
query.include(["user", "user.pais"]);
I've seen some examples where developers used it.
SECOND EDIT:
The last thing I've used is fetch like:
Parse.Object.fetchAll(books, {
success: function(list) {
response.success(list);
},
error: function(error2) {
response.error({'resp': error2.code, 'message': error2.message});
},
});
But didn't work either.
This is starting to freak me out.
OUR WORKAROUND:
The workaround we're trying to do is fetching everything separately, and then returning back to the user together. This is not a good practice since a little change in the class in a future would ruin the whole function.
Is this a bug in the SDK ?
(This is a comment turned into an answer)
Just a thought because I recently had a problem with CloudCode that is quite similar to yours. What version of the JavaScript SDK are you using? I solved my problem by changing the version back to 1.4.2. It's just a shot in the dark in your case, but it might work.
Here is the thread where I described the problem and how to solve it by changing the SDK version.

Error when creating charge with Parse.com Stripe API

I'm trying to create a charge with a test account on stripe.
Here is my parse cloud function:
Parse.Cloud.define("charge", function(request, response) {
var Stripe = require('stripe');
Stripe.initialize('...');
Stripe.Charges.create({
amount: 1000,
currency: "usd",
customer: "..."
},{
success: function(httpResponse) {
response.success("Purchase made!");
},
error: function(httpResponse) {
response.error("Uh oh, something went wrong");
}
});
});
I've hard coded the customerID into the function just for testing.
When I call the function from my app, I get the following error:
TypeError: Object [object Object] has no method '_each'
at request (stripe.js:58:11)
at post (stripe.js:117:12)
at Object.module.exports.Charges.create (stripe.js:157:16)
at main.js:19:18 (Code: 141, Version: 1.6.2)
Can anyone help?
#user3707419 I get the same error when trying to add a customer. Comment out that line and instead add the following:
card: stripeToken //this is the token you generated
Also, if that doesn't work, you need to revert you parse cloud code version to 1.5.0 (you are probably running the latest version 1.6.0 which does not work. The way you do this is type the following into your console:
parse jssdk 1.5.0
All of my working code on version 1.5.0 is located at this post:
Complete working Stripe + Parse.com working code on version 1.5.0
We may have to revert back even further to get customer: customer.id working I'm not sure. Let me know if you figure a different solution out. Hope this helps.
For what it's worth, your code looks very similar to my cloud code that works. However, I do not have a semicolon after the first }). Just after the final one.
If that's not the error, then i'm not very sure how to interpret your errors because i cannot see the code at the mentioned lines. Best of luck
Just so you know the real reason: Parse removed underscore lib , stripe.js thats built into parse cloud code relied on it. Hence failure like this.
Parse 1.6.X no longer supports modules, they removed them from API doc as well.

gapi.client.load error "Ignoring mismatched auth param scope=https://www.googleapis.com/auth/plus.login"

From today I'm starting having troubles getting user's friends list with JS, when i load the plus api with "gapi.client.load('plus', 'v1', callbackFn)" I see in firebug logs the message
"Ignoring mismatched auth param scope=https://www.googleapis.com/auth/plus.login"
And then when I call gapi.client.plus.people.list({'userId': 'me', 'collection': 'visible', 'fields': 'items(id)')
It fails saying "Invalid string value: 'visible'. Allowed values: [pages]"... when it's not true!
Yesterday was working fine, I could get my friend's ids and today stopped...
Even trying to create a new application and api key always get the same error, something changed on big G plus apis?
I'm having headache, anyone having this trouble?
Update 1:
I've found an example from google developers guide and followed line by line:
https://developers.google.com/api-client-library/javascript/start/start-js
That's exactly whath i'm doing and... same result! :(

Chromium error with SPDY when using Facebook JavaScript SDK

I develop a mobile application with HTML5 + Cordova (Phonegap) using Facebook Javascript SDK for iOs and Android.
I implement it like this :
FB.api(
{
method: 'fql.query',
query: 'SELECT uid, name, birthday_date FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())'
},
function(response) {
console.log(response);
// some code
});
It worked for several months on Android & iOs, until yesterday, on Android.
An error occurs when the call to the api is doing and the callback function is not called.
Here is the error from LogCat in eclipse :
02-26 12:27:10.526: W/chromium(22379):
external/chromium/net/spdy/spdy_session.cc:1246:
[0226/122710:WARNING:spdy_session.cc(1246)] Could not parse Spdy
Control Frame Header. 02-26 12:27:10.526: D/chromium(22379): Unknown
chromium error: -337 02-26 12:27:10.526: W/chromium(22379):
external/chromium/net/spdy/spdy_session.cc:1058:
[0226/122710:WARNING:spdy_session.cc(1058)] Received data frame for
invalid stream 1 02-26 12:27:10.526: W/chromium(22379):
external/chromium/net/spdy/spdy_session.cc:1058:
[0226/122710:WARNING:spdy_session.cc(1058)] Received data frame for
invalid stream 1
It seems to be an error of the android browser Chromium when calling query Facebook (which using the protocol spdy)
Anyone has an idea ?
Thank you !
Seeing the same thing!
/chromium( 1942): external/chromium/net/spdy/spdy_session.cc:1246: [0307/015242:WARNING:spdy_session.cc(1246)] Could not parse Spdy Control Frame Header.
W/chromium( 1942): external/chromium/net/spdy/spdy_session.cc:1058: [0307/015242:WARNING:spdy_session.cc(1058)] Received data frame for invalid stream 21
W/chromium( 1942): external/chromium/net/spdy/spdy_session.cc:1058: [0307/015242:WARNING:spdy_session.cc(1058)] Received data frame for invalid stream 21
D/chromium( 1942): Unknown chromium error: -337
Found news about FB implementing SPDY without much news:
http://zoompf.com/2013/03/facebook-adds-spdy-support
Surprised we're not seeing more issues around.
I have the same problem with the similar code under identical
circumstances, PhoneGap, Android
The solution is to switch to Graph
API. Using Graphi API the same call will be
FB.api('/me/friends', { fields: 'id, name, gender, username' }, function (response) { ... });
There are a number of caveats that might
not be applicable to you but were applicable to me
The fields named differently. “sex” is now “gender”, for example Graph API does not
have direct analog of is_app_user field. If you add it to the list
of fields, you’ll get an error. There is a workaround asking
specifically for the users who installed the app
There is paging
implemented in response. So the response is structured a bit
differently. If you used to pass the data for processing to
functions you shall pass not “response” but “response.data”, and
watch for “response.paging”, to see if there are more friends to add
by additional calls.

Categories