Exception when trying to tag a photo

May 28, 2010 at 8:07 PM

Hello, I'm trying to tag a photo from a desktop (Winforms) application, usigng the AddTag method, but I'm getting the following exception:

"A session key must be specified when request is signed with a session secret."

I read something about passing a session key instead of the user id when using the Api from a desktop app but I'm not sure how this should be done.

Any help will be apreciated.

Thanks a lot,



Jun 3, 2010 at 4:51 PM

Any clue? Anyone?


I have defined my own version of the AddTag Method like this:

         public bool AddTag(string pid, string tag_text, float x, float y)
            var parameterList = new Dictionary<string, string> { { "method", "facebook.photos.addTag" } };
            Utilities.AddRequiredParameter(parameterList, "pid", pid);
            Utilities.AddOptionalParameter(parameterList, "tag_uid", 0);
            Utilities.AddOptionalParameter(parameterList, "tag_text", tag_text);            
            Utilities.AddRequiredParameter(parameterList, "x", x);
            Utilities.AddRequiredParameter(parameterList, "y", y);           

            var response = SendRequest<photos_addTag_response>(parameterList, true);
            return response == null ? false : response.TypedValue;

The main difference with the original implementation is that I passed "true" as the second parameter to the SendRequest method, so finally when it calls the SendRequestSynchronous it adds for me the session_key parameter.

I'm getting an 'Invalid parameter' exception (error code 100).

Any help wil be very appreciated.

Best regards,









Jun 4, 2010 at 2:13 PM

Ok, finally could make it work.

I called the function like this:

Api.Photos.AddTag(pid, uid, "test", x, y);

where uid is the id of the user I wanted to tag. I guess there's a bug in the docs. The explicitly state that when calling this function from a desktop application the user id shouldn't be passed.

Am I right?