Tag photo Graph API / REST API

902 views Asked by At

I'm doing a FB app with the Graph API in Flash. I've got everything working which consists in uploading some images created by the user in the app. The only part that I'm missing is how to tag these photos as with the Graph API it is not possible.

So I was wondering if it's possible to call a method of the REST API even though I'm using the Graph API. Any suggestion on how to deal with that?

Thanks

1

There are 1 answers

0
pearlchen On

This question was asked a long time ago but no answers for when I was looking so here's the answer. (Hint: it's all about the formatting of the JSON string within the param object being passed to the Graph API)

function postPhoto( e:MouseEvent ) : void
{
  var bitmapData:BitmapData = new BitmapData( 600, 600 );
  bitmapData.draw( someSprite );
  var bitmap:Bitmap = new Bitmap( bitmapData );
  var params:Object = { image:bitmap, message:'Message', fileName:'file-name', tags:'[{"tag_uid":"12345678","x":"0","y":"0"}]' };
  FacebookDesktop.api( 'me/photos', photoPostComplete, params );
}           

function photoPostComplete( result:Object, fail:Object ) : void
{
  //do callback type of stuff
}