I am using facebook-c#-sdk to develop a winform FaceBook app, this app should be able to accept friend request and chat with people.
But I didn't find any samples on how to access friend_request in the facebook-c#-sdk.
Can someone help to point out how could I accept friend request?
And especially how can I get the notification first and then accept the request?
Extra information:
The API, [facebook-C#-SDK] is officially supported by Microsoft
http://developers.facebook.com/tools/third-party-sdks/
I already check out the following post but found no solution to my problem.
Accept or decline Friend Request using FB Graph API
If you like, you can chat with my bot during office hour, it works only if I manually accept your friend request.
http://www.facebook.com/ictbot.np
AFAIK, consistent with Igy's link, there is no way for an app to send, accept or refuse a friend request. This is one of many capabilities which Facebook presumably does not consider appropriate for apps.
See https://developers.facebook.com/docs/reference/fql/friend_request/ on reading friend requests using the API, including the considerable limits on doing so.
Thanks Jon Newman for pointing out the limitation of API.
Basically there is no way to do so with Facebook API.
But I do have a workaround, and this workaround only works for certain scenario:
"When you have full control of a facebook account"
In my case ,the app is used only by my Facebook account. I have full control of both, so I will set the notification on in account setting.
When a friend request is send to my facebook, the notification is also send to my gmail.
Then I can retrieve it from gmail, filter out html tag, then a link will appear, open that link in browser.
Done.
Miscellaneous:
1)To retrieve email in gmail:
http://imapx.codeplex.com/releases/view/98061
Basicly Program.ImapClient.Folders[0].Messages[#].HtmlBody.TextData will give you the html data.
2) If your url is wrong, you will be redirected to friend request list where you can accept request manually.
Related
Since the existing instagram APIs are deprecated, I am switching to the graph api.
Below is what i want to achieve and what the issue is.
Requirement.
I would like to track the number of likes and comments on instagram posts in which my business account is mentioned using #. I have setup the faccebook and instagram accounts along with the webhook. The webhook is going to send me the "mediaid" in which i my business account is tagged.
Since the app is in the development mode i am not receiving the webhooks if i mention the business account in any of the post, but i am able to send the test webhook from the developer account console. So i assume once the app is in LIVE mode it will start sending the webhooks to my server.
Once the "mediaid" is received i would like to make a call to another api https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media
in order to get the number of likes and comments.
I am facing an issue on the 2nd part. Whenever i call the api mentioned in the 2nd part i am getting the error
This api call works fine when i pass the mediaid that my instagram business account owns. But as soon as i pass the mediaid of the post which mentioned my business i am getting the above error.
I just wanted to check if this is also a limitation of my facebook app being in a development mode ? Please suggest a solution to achieve this scenario.
I tried the same what you did but with a live facebook app. From the webhook, I got an event when any other user mentioned my instagram business handle in caption and am able to fetch the mentioned media details using the mentioned media API https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media.
As you didn't share the webhook event payload, I am just assuming you are using the correct user id while making the API call. The JSON path of the user id in event payload is entry[0].id
I have very minimal experience with anything web related so apologies if this is a silly question.
I have a Wordpress site with a contact form which users can use to send me a message from the website. The user fills out the form, and it is converted into an email and sent to me.
I would like to have similar functionality from my c# desktop application.
In other words, I am looking for a way to either programmatically invoke the contact form on my website, or to send information to my website, which it will convert into an email and send it to me directly.
What general concepts should I be looking into?
The information typed into the web form is probably sent back to the web server using the HTTP POST method. Essentially the data entered into the web form is converted to name values pairs and sent to the WordPress app. More information on HTTP POST here: HTTP POST (Wikipedia)
To do the same from a C# app, you need to format the data to POST in a similar way and then look at using the HttpWebRequest class. This stackoverflow thread shows an example: HTTP request with POST. If you POST the information to the same URL the web page is using then the server should generate the email.
Just to note as well, if the WordPress app requires you to be logged in before submitting the information, then you'll need to include code to authenticate with the WordPress app within the C# app.
I hope this helps!
after I did some research on the subject, I found that Windows Live stopped providing email addresses for a user's contacts through its API. Instead, they provide the email hashes.
I did a little more research, and i found many websites being able to retrieve the contact list for a user and displaying it (with emails, not hashes) but the difference is that i don't think they are using oAuth since to retrieve the emails, the user must provide his email/password.
I need to implement importing a user's contact list on my site and i see no workaround to doing it using oAuth REST requests through Live's API (granted that i was being able to get the access token and make other REST requests).
If not using oAuth, what are other ways of getting a Windows Live/Hotmail contact list?
I ended up using Windows Live ID's Delegated Authentication. Even tho it's deprecated it'll have to do until i find a more effective solution.
I am playing around with Google Music. I'm trying to see if I can write an app that will stream my music files uploaded to Google Music. So far, I've managed to authenticate myself using ClientLogin and access the music.google.com page. However, whenever I try to access http://music.google.com/music/services/loadalltracks, the page that contains all of my tracks in JSON format, I get a 401: Unauthorized error. However, if I pass the cookies containing SID and HSID, it works and I can access the page.
Does anyone know why It doesn't work with ClientLogin, outside of Google not supporting it with Music? Have you had similiar experience with other Google Services? In the event I can't get ClientLogin to work, is there anyway to work around it, using the SID? I don't know how the HSID is generated.
Since there is no official api for Google Music, you need full SSO credentials to use those endpoints. The easiest way to do this is to emulate a browser (with eg mechanize).
The way my unofficial Google Music api accomplishes this is a bit cleaner, but more work: use clientlogin to authenticate to the Music Manager service, then upgrade those credentials using tokenauth. This isn't really a public feature, but it's described by a third party here, and by a Google design doc here. The specific endpoints you need are in my code here (in clientlogin.py and tokenauth.py).
You'll want to send u=0 and xt=[value of xt cookie] in the querystring as well. The first argument specifies which account you're using (if you're signed into multiple), and the second is a xsrf token.
Well, as far as I can tell the reason sending the SID and HSID cookies makes the request work is because you're simulating the way a normal user is accessing the service.
You can't go the regular application way because that's not supported in google music (as far as my internet research showed, there's no API for google music).
Oh, and one thing: google discourages people from using ClientLogin and instead tells people to use OAuth ("ClientLogin [is] Google's proprietary authorization API ... you should avoid using [this] service." found at http://code.google.com/apis/gdata/docs/auth/overview.html) so in the future you might want to use that. Maybe it'll even work in this case (It sends a different token from ClientLogin - OAuth token instead of an Auth token) though I doubt that.
Anyway, I hope this cleared things up.
new to facebook dev and I have read the basics to get a site up and running using the canvas setup. Nice and simple, I have also got the integration with users working ok (i.e. the signed_request).
I was wondering how it works with "sending/posting" data from one site that is anonymous (my own external to facebook) to the facebook site.
The flow I'm after is a user is looking at some content my site A (my own external site) and then clicks the "share on facebook" button (or whatever), which sends the user (and the data they were looking at) to the site B (my facebook app) to which they authenticate and then (and this is the part I dont get) can see that content on their personalised homepage within site B.
So is there a way to POST some kind of data to the facebook site? Or do I need to do something else here?
Thanks a lot.
You use the facebook API located here:
http://github.com/facebook/csharp-sdk
The .zip download includes the api that you can compile, as well as a sample project that uses it.
Reference: http://developers.facebook.com/blog/post/395/
EDIT
Here is some more info regarding the facebook graph api. I think you'll find everything you need in here: http://developers.facebook.com/docs/reference/api/