Hi currently using people API by google, But i am having some errors on request "api.client.people.people.connections.list" on API.
The picture below will show the error, The first picture is the console error. and the other one is the code error it shows that the list is cannot read property of undefined. The code is in below.
var request = gapi.client.people.people.connections.list({
'resourceName': 'people/me',
'requestMask.includeField': ['person.phoneNumbers', 'person.names','person.emailAddresses'],
'sortOrder' : 'FIRST_NAME_ASCENDING',
'pageSize': 500,
});
I ran into this too, their tutorial here has the same problem https://developers.google.com/people/quickstart/js.
Now you have to do gapi.client.people.people.me.connections.list
And list doesn't take a resourceName param anymore, you can see that here https://developers.google.com/people/api/rest/v1/people.connections/list.
It would be nice if they would update their tutorial...
This works today.
gapi.client.people.people.connections.list({
The accepted answer was posted in 2017 so the API has probably changed somehow, but I copied the code for the above function and the call works for me. You can find the full source at: https://developers.google.com/people/quickstart/js
Related
I'm trying to retrieve a content from the specific ical url using ical npm.
I'm testing this code on the client side. There are a few icals that I've managed to fetch. But this one and several others I didn't.
It works great on POSTMAN.
My code is:
const ical = require('ical');
ical.fromURL('https://admin.vrbo.com/icalendar/5d19afbfbf144218a3c76eacf76267c6.ics', {mode: 'cors'}, (err, data) => {
console.log(err)
});
The error I get:
Error: Invalid value for opts.mode
at new push../node_modules/stream-http/lib/request.js.module.exports (request.js:58)
at Object.push../node_modules/stream-http/index.js.http.request (index.js:30)
at Object.push../node_modules/https-browserify/index.js.https.request (index.js:13)
at Request.push../node_modules/request/request.js.Request.start (request.js:829)
at Request.push../node_modules/request/request.js.Request.end (request.js:1639)
at end (request.js:628)
at request.js:644
at run (setImmediate.js:48)
at runIfPresent (setImmediate.js:83)
at onGlobalMessage (setImmediate.js:125)
Pleas tell me what I'm doing wrong and how to make this code work.
I think the issue here is, that you are trying to pass an invalid option ({mode: 'cors'}). ical.fromURL(...) will pass the options argument as it is to request (See Line 8). I've checked the source of request, but did not find any option with the name mode (Maybe you are mixing it up with the Fetch API, because there is an option called mode), so in my opinion, that is also the reason, why you are getting the error (But I'm not sure why it worked out for you, to fetch some other calendars). You can check the full list of possible options by yourself.
I used the Graph API with javascript to fetch all of my data contained locations in v1.0.
( I used FB.api("/v1.0/me/locations", function (response) { ... }); )
I know that the updated version is 2.2 and the "locations" node is replaced by "tagged_places" node in v2.0 and above.
I also use the Graph API Explorer to test my results.
I try this, GET: /v2.2/me?fields=tagged_places
and the results are exactly what I want.
However, in my js code, I try: FB.api("/v2.2/me?fields=tagged_places", function (response) { ... });
and there is NO any results!
Besides,
I set version: 'v2.2' in Parse.FacebookUtils.init();
I also ask the permissions :user_tagged_places,user_photos,user_status,user_friends,user_about_me,user_birthday,read_stream in Parse.FacebookUtils.logIn();
I need almost all of the data of my checkins(a.k.a locations in v1.0/tagged_places in v2.0) to add into my database.
I try to fetch /me/photos, but the results are not satisfied. So I still need to use maybe this: FB.api("/v2.2/me?fields=tagged_places", function (response) { ... });
So... can anyone help me? please....
I went through permissions in groups testing them out and I figured out what the problem was.
You need to have the permission of the item you were tagged in.
So in my case I was tagged in photos, so I needed user_photos permission to gain access to user_tagged_places. It actually creates quite an issue because you need to know how a user was tagged to retrieve their tagged_places.
If a user was tagged at a place in a post you need a different permission than if they were tagged in a photo.
After few attempts, I am still unable to find the right way to update a list in firebase.
I have my dev account in firebase. But,just for this question I used the sample on the public firebase url:
var url1= new Firebase("https://samplechat.firebaseio-demo.com/message_list");
url1.push({text:'Its working',user_id:'123'});
setTimeout(function (){
url1.on('child_added', function(snap) {
snap.update({text:'Its not working',user_id:'123'});
snap.child('text').update('Its not working');
console.log('messages in range', snap.val());}
)},6000);
I am able to set the data, but when the child_added function is triggered for the messages. I am getting the below javascript error:
Uncaught TypeError: undefined is not a function
What can be the issue ?
You aren't using the data snapshot object correctly within your function.
https://www.firebase.com/docs/javascript/datasnapshot/index.html
Change it to
snap.ref().update({text: '....', user_id: '...'});
If you were just looking to get the value, you'd use
snap.val()
please provide more information on what you're trying to accomplish. Right now you're trying to update your snapshot(snap.update). I'm not sure what that's for. Instead of calling your snap, you can call your reference, url1.update. Also, take another look at the docs for reading data, https://www.firebase.com/docs/reading-data.html and writing data, https://www.firebase.com/docs/writing-data.html. Looks like you've combined functions from reading and writing data.
I have a problem with http://yuilibrary.com/gallery/show/notify
Unfortunately I'm using the older version of YUI (3.4.0) so it's even harder to search for the solutions. I can't change it so I have to stick to it :(
I have read documentation page a couple of times, but I still can't figure out how to use flag. It says it's a part of configuration of Y.Notify.Message, but how do I access it? There is no example on the site except a very simple way of using Y.Notify constructor.
I was trying something like that:
notification.add({
message : 'Some message',
flag : 'some_flag',
timeout : 1000,
});
Unfortunately it does nothing ...
Any help will be appreciated, because I'm leaning to some 3rd-party library more and more... Still I would rather use something that is part of the framework I use.
The funniest part is I have checked the source code on the github:
https://github.com/yui/yui3-gallery/blob/master/src/gallery-notify/js/notify.js
...and I don't see any flag there :(
However have I found one here:
https://github.com/yui/yui3-gallery/blob/master/src/gallery-notify/js/notify.js~
What is the current version? Anyone?
I also checked the github repository for https://github.com/apipkin/xarno/blob/master/src/gallery-xarno-notify/js/notify.js which should be the most recent version of the code and it also has no flag.
Thanks a million!
It's a bug. You should contact the author.
A workaround to add a class for skinning would be to create the message as a widget first, add your class and then pass it to Y.Notify:
var message = new Y.Notify.Message({
message: 'Some message',
timeout: 1000
});
message.get('boundingBox').addClass('my-skin-class');
notification.add(message);
Another option would be to add it as an object to the notification widget and then retrieve it using item(index):
notification.add({
message: 'Some message',
timeout: 1000
});
notification.item(notification.size() - 1).get('boundingBox').addClass('my-skin-class');
hi i am try to integrate LinkedIn with my mobile application which is developing in phonegap with Xcode.
Now i have get the authorization using javascript library from github(https://github.com/bytespider/jsOAuth/blob/daa8823a02fa570b285ac26f66ff6c5d8be9d4ec/src/OAuth/Consumer.js)
jsoauth but i do not know how to set header for "https://api.linkedin.com/uas/oauth/accessToken" any one please give example for it.Now i got oauth_token,verifier,oath_token_secret.how can i use it? i get the problem send like
code is:
var options={
consumerKey:'XXXXXXXXXX',
consumerSecret:'XXXXXXXX',
verifier: verifier,
signatureMethod:'HMAC-SHA1'
};
oauth = OAuth(options);
oauth.post('https://api.linkedin.com/uas/oauth/accessToken', null,
function(data) {alert('acess');
window.plugins.childBrowser.close();
},
function(data) {
alert('no access');
console.log(data.error);
}
);
here the error function called and Xcode error shows like:
* WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: * -[JKArray objectAtIndex:]: index (1) beyond bounds (1)
any one help me how get the AccessToken of LinkeIn.
I don't think you can set the verifier as an option.
Try using the function
oauth.setVerifier('verifier')
&
oauth.setAccessToken('MY-ACCESS-KEY', 'MY-ACCESS-SECRET');
http://bytespider.github.io/jsOAuth/api-reference/
After that, the jsOAuth will set the headers for you.
I also just had a problem fetching the access token using this library and it turned out that it was including the callback parameter unnecessarily, which made the request fail.