How To Post Photo To Album In Facebook Graph Api

Mar 27, 2011

i wrote an application for facebook but i couldn't upload image to album that i created,
code is in below

Facebook.FacebookAPI api = new Facebook.FacebookAPI(GetAccessToken());
Dictionary<string, string> album = new Dictionary<string, string>();
album.Add("name", "Test Album");
album.Add("message", "Message here!");
JSONObject result = api.Post("me/albums", album);
string AlbumId = result.Dictionary["id"].String;
Dictionary<string, string> photo = new Dictionary<string, string>();
photo.Add("message", "test Message");
photo.Add("source", "tgw.jpg");
JSONObject photoResult = api.Post("/" + AlbumId + "/photos", photo);

View 1 Replies


Similar Messages:

C# - Facebook Connect - How To Post To User's Wall Using Graph API

Jul 26, 2010

I've integrated my website with Facebook Connect, authorization/single-sign on all working great.

Now im trying to post something to the user's wall, which im having some problems with.

First of all, im using the "old" JavaScript API (FeatureLoader.js).

These are the Graph API URL's im using:

private const string UserDetails_Url = @"https://graph.facebook.com/{0}?access_token={1}";
private const string Feed_Url = @"https://graph.facebook.com/{0}/feed?access_token={1}";
private const string TokenExchange_Url = @"https://graph.facebook.com/oauth/access_token?{0}";

I'm using the TokenExchange_Url URL to receive the unique user OAuth token to make calls with.

This is working fine, because a) i receive the token back, and b) i can issue HTTP Get Requests to the Graph API (i.e UserDetails_Url) and it works fine.

But, i cannot Post to the User's wall using the Feed_Url.I'm pretty sure the issue is i haven't got the appropriate user permissions to post to a wall (i.e facebook-side setting).

Now, i realise i can use the fbPublish API method client-side to do this, but i want to do it server-side with the Graph API.

I wont bother showing my code which attempts the call to the Graph API to post to the user's wall, as its pretty straightforward (HttpWebRequest, set method to "POST', set content type/length, write bytes to Stream, etc).

I think the problem is i need the user to grant my aplpication "publish_stream" extended permissions.

The Facebook Graph API doco says to do this in your authorization request:

https://graph.facebook.com/oauth/authorize?
client_id=...&
redirect_uri=http://www.example.com/callback&
scope=user_photos,user_videos,publish_stream

Which confuses me because im using the following URL to get the OAuth token:

https://graph.facebook.com/oauth/access_token?bunchofqsparams

Am i using the wrong Token Exchange URL? Why is there two different URL's to seemingly get the same piece of information?

Yes - i have read the Facebook API doco (numerous times), and yes i have read other similar SO questions, but they all result in using the client-side API to publish to wall, i want to do it server side.

For the actual "Facebook Connect" button, i'm using the standard FBML:

<fb:login-button length="long" size="medium" autologoutlink="false" background="light" onlogin="facebookLogin('/login')" class=" fb_login_not_logged_in FB_login_button FB_ElementReady"><a id="RES_ID_fb_login" class="fbconnect_login_button"><img id="RES_ID_fb_login_image" src="http://static.ak.fbcdn.net/rsrc.php/zB6N8/hash/4li2k73z.gif" alt="Connect"></a></fb:login-button>

When i click this (and not logged into Facebook), it pops up a window which the user can login. But it doesnt have the "Request Extended Permissions" dialog - shouldnt it? Or is that another popup i need to manually trigger?

So to sum up, here are my questions:

How do i grant extended permissions to publish to the user's wall?What is the correct URL for obtaining an OAuth token?Is there a definitive source for showing how to post to a user's wall using server-side Graph API calls?

View 1 Replies

Social Networking :: Post Message To Friends Wall Using FaceBook Graph API

Nov 15, 2012

how to post feed OUR wall. now, my friend wall, using their ID.tried with 

FaceBookConnect.Post(ViewState["Code"].ToString(), "/<friend ID>/feed", data);
--> failed :-(
FaceBookConnect.Post(ViewState["Code"].ToString(), "/<friend ID>/notes", data);
  --> also failed

also tried with :  "/<friend ID>/notes" which also failed.

View 1 Replies

JQuery :: Create A Photo Album In Website?

Feb 10, 2011

I want to create a photo album in my website like the following link

[URL]

View 3 Replies

Web Forms :: How To Create An ASP Photo Album Page WITHOUT Using A Database For The Photos

May 28, 2010

Can anyone tell me how to create an ASP photo album page WITHOUT using a database for the photos? In other words, I just want to be able to call the photos from a folder within the site... I can't get databases to work properly on my computer so I need to do it this simpler way. Can anyone let me know of a site which shows how to do this

View 19 Replies

Sorting (rearranging Order) Of A Photo Album Using JQuery Sortable?

Feb 6, 2011

I have a photo album gallery within my website and would like to allow users to sort the order of their photos within an album. After looking at very different ways I came across this example http:[URL]Admin=true which is exactly what I need.

The photo are stored in the uploads directory and details in the database. The images are displayed using the ListView as shown below:

<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" GroupItemCount="15">
<LayoutTemplate>
<table id="groupPlaceholderContainer" runat="server" border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse; width: 100%;">
<tr id="groupPlaceholder" runat="server">
</tr>
</table>
</LayoutTemplate>
<GroupTemplate>
<tr id="itemPlaceholderContainer" runat="server">

[Code]....

View 1 Replies

Forms Data Controls :: Filling Table Like Photo Album?

Mar 1, 2011

I need to create a display grid of picture cells 5 columns by rows determined by database select. Each cell to contain picture, title, name, phone number pulled from database. How do I create a table like structure and populate it? Can a DetailsView control be called into each table cell with the table row count being determined by the same select statement?

View 2 Replies

How To Upload An Image On Facebook Album

Dec 11, 2010

I am trying to upload an image using ASP.NET with C#.I do not how to send image in parameter source="F://sample.jpg".I have also tried to send an image in a byte format.

URL is [URL

Post Data is source= "F://sample.jpg"

I am getting an exception.

View 1 Replies

JQuery :: Sorting (rearranging Order) Of A Photo Album Using JQuery Sortable

Feb 6, 2011

I have a photo album gallery within my website and would like to allow users to sort the order of their photos within an album. After looking at very different ways I came across this example

http://www.west-wind.com/rick/photoalbum/demoMaui2006/Default.aspx?Admin=true which is exactly what I need.

The photo are stored in the uploads directory and details in the database. The images are displayed using the ListView as shown below:

[Code]....

I would like to rearrange the order of the photos; change the captions and/or delete the photos just like as in the example.

So could someone please provide the steps that I need to follow in order to achieve the following:

Firstly to display the photos from the Photo table in the database (can use the above listView) Rearrange the order; change caption and/or delete the photo(s) Final to update the changes in the Photo table

I am new to programming, especially jQuery so could you kindly provide/explain the steps that I need to follow.

View 8 Replies

Social Networking :: How To Get High Quality Album Photos From Facebook

Aug 23, 2013

I have refer source code and apply to my web from your article as 

<a href="http://www.aspsnippets.com/Articles/Import-Facebook-Album-Photos-and-display-as-">Here</a>:

It successful get the album and photos. But I have a question about how do i get the higher quality photo ?

For example:

image as below is get according your code: [URL] ....
 
Image as below is get from facebook by click to album and view: [URL] ....

View 1 Replies

Social Networking :: Import Facebook Album Photos And Display As Image Gallery

Jan 3, 2013

I have used downloaded code of (Import Facebook Album Photos and display as Image Gallery in ASP.Net) but it could not work for me .

In the code there is used query string for code so i want to know from where the code value comes and for what purpose we r using this.

protected void Page_Load(object sender, EventArgs e)

View 1 Replies

How To Use Facebook Graph Api

Sep 17, 2010

I am using facebook graph Api for my application where i want the data of this page.

http://www.facebook.com/pages/

In this page there is option TV SHOW I want collect all information of that page.
But i didn't any graph api method for this page.

View 1 Replies

How To Get My Friends Using My Facebook App With Graph Api

Feb 16, 2011

i'm using Facebook C# SDK i can get my friends like;

JsonObject friends = (JsonObject)facebook.Api("me/friends?");

But i couldn't get my friends which uses my application how can i get them?

View 2 Replies

C# - How To Upload Photo With Facebook API

Mar 22, 2010

How can I upload a photo file automatically with ASP.NET using the Facebook API?

View 1 Replies

Web Forms :: Photo Tagging Like Facebook?

Sep 8, 2010

I'm trying to create an image gallery where you can create tag on the photo like on facebook.Does anyone knows any free library to do this... I have already searched on google but i don't be able to find anything :S

View 1 Replies

C# - Facebook Graph API Getting Data When User Not Logged In

Feb 28, 2011

I have this requirement of fetching facebook user information like friends count and other basic information and integrate to our website.

I currently use facebook graph to ask user to authorise, fetch information and store in my database.

When their say, friend count changes how do I update my database without asking user to trigger it manually.

Is there a special permission where i can fetch user data when he/she isnt logged in.

I have seen this somewhere but not sure of the permission.

Or does facebook have any feature of publishing information on subscription ?

View 2 Replies

C# - How To Use Localhost While Developing Facebook Graph Website

Jul 20, 2010

i want to use localhost for developing website facebook application using the graph api.
i working in asp.net c#

in the previous api of facebook i was abe to write the
http://localhost:4300/ in the connect url at the application settings.

now it dosent work.it keeps telling me
An error occurred with application name. Please try again later.

** if i upload the website, and use the website coonect url, it is working.

View 3 Replies

How To Get The Work Information From A Facebook User Using Graph API

Mar 17, 2011

I am tying to get the work information from a facebook user using Graph API

When I use the Graph API and get the User object, it contains work information, which is essentially a list of the work history. The list elements contain nodes of employer, location, description, etc...

The FQL return it as a JsonObject, how do i get the the value employer out of it. I am only interested in the last employer. I tried something below but could not get it working.

[Code]....

There is more information that says it return the "work_history" as an array

http://developers.facebook.com/docs/reference/fql/user/

View 7 Replies

Javascript - Best Practices For Facebook Integration Using The Graph API

Mar 27, 2011

When it comes to integrating your site with facebook, is it recommended to save all the user's info from Facebook to your DB, or is it recommended to query in real time all the info you need based on the user's id?

For example the avatar sizes are different on my site than on my facebook, so I may have no choice but to download the fb avatar, but for other things like name, gender, hometown, I was wondering if I need to save that data. Also, if I decide to change extended permissions at a later time, is that going to be an easy task?

View 1 Replies

Social Networking :: How To Logout From Facebook Using Graph API

May 17, 2013

I am following your code for integrating facebook authentication.

It really works fine, but as per your post at [URL] ....

We cant use dll to logout from facebook. Is there any way around or do we need to use use facebook sdk for just logging out?

View 1 Replies

Social Networking :: Add Friend Using FaceBook Graph API?

Dec 31, 2013

i want a code to search a friends and send a request (add to my friend)

View 1 Replies

How To Create Photo Albums Like Facebook Style

Jan 7, 2010

I want to implement and allow users to create their own photo albums on my website.Now i was proposing that i have 2 tables:-Quote:
tbl_albums{album_id, user_id, album_name, info, date_added}
tbl_album_images{image_id, album_id, user_id, caption, date_added}
So one table would contain information about the album and the other would be the images inside the album.firstly does this seem like a good approach?If so, i want to know what would be the best way to allow users to do this?

View 6 Replies

VS 2008 - How To Submit Photo To Facebook From Website

Oct 29, 2012

I need to take a picture and submit it to my facebook wall automatically including text if included. Is there a way to do this from asp.net? I do not want to use any user interface - I want this to be automatic. As new pictures come on my server I want to post them right then.

I looked at the developer pages of fb but can't find anything that is more automated. What is the best and easiest way to submit the pictures?

View 2 Replies

C# - How To Get The Data From Facebook's Live Stream Plugin Out Via The Graph API

Nov 10, 2010

We're thinking of making use of the Facebook Live Stream social plugin for our site (example here), but I wanted to know if it was possible to access this data via the Graph API?

View 1 Replies

Parsing Facebook Open Graph Api Json Response In C#

Jul 14, 2010

I try to get parse JSON response for the following link:
https://graph.facebook.com/feed/?ids=135395949809348,149531474996&access_token=

The response is like that:
{
"135395949809348": {
"data": [
{
....Some data
}]
}
,
"325475509465": {
"data": [
{
....Some data......
}]
}
}

I use System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(string json) method.
But the objects key names always different , so I can't define the class that can be used for parsing this response.Is anyone has any experience in parsing multiple id's response from Facebook?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved