events.invite does not exist

Oct 21, 2009 at 5:17 PM

Hello,

I was wondering if there is a reason why the method events.invite is not in the current API. Can my application send events invitation or is it prohibit?

I'm creating meetings automatically throw the application and I want to send to all the users who have facebook the invitation. Is this possible?

Regards,

Gabriel

Jan 25, 2010 at 7:08 AM
gwagner wrote:

Hello,

I was wondering if there is a reason why the method events.invite is not in the current API. Can my application send events invitation or is it prohibit?

I'm creating meetings automatically throw the application and I want to send to all the users who have facebook the invitation. Is this possible?

Regards,

Gabriel

 Hi gwagner,

Have u did events.invite. I am facing the same problem. I want to send invitations to my friends. If u did please help me regarding this.

Thanks,

Ibrahim.

Jan 28, 2010 at 3:44 AM

For those wondering the toolkit is completely missing events.invite.  Every event method is included except for invite.  Why on earth did they include the ability to create, edit, cancel, etc but no Invite?

http://wiki.developers.facebook.com/index.php/Category:Events_API

Is anyone working to add this to the toolkit?  I've been looking through the source code and I may just add it myself.  If I do I'll post it.

Jan 29, 2010 at 1:21 AM

Found a few more details.  It looks like events.invite was added to the REST API only a week or two before the 3.0 toolkit was released.

http://developers.facebook.com/news.php?blog=1&story=328

I'm working on some code to add it.  It keeps returning False though...

Feb 17, 2010 at 3:06 PM

I have what I believe should be working code to make the call to Events.Invite.  While the call to Facebook is no longer producing errors it only returns 0 no matter what I do.  I can remove and add inputs and Facebook returns exceptions so I believe my inputs are correct.  It also looks like the Facebook platform on the API side does not include the necessary code to handle the request.

More details can be found in the bug I filed with Facebook here.
http://bugs.developers.facebook.com/show_bug.cgi?id=8515

Note the response from Facebook nearly 3 weeks ago was "thanks, we'll look into it".

Mar 3, 2010 at 3:05 PM

I think this works now. I added the code myself to the library and although still "false" is returned the invites are sent out.

Xsd2CodeSourceExtension.cs

[XmlRootAttribute("events_invite_response", Namespace = "http://api.facebook.com/1.0/", IsNullable = false)]
    public class events_invite_response : BooleanResponse { }

 

Events.cs

private bool Invite(long eid, List<long> uids, string personalMessage, bool isAsync, CancelEventCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.events.invite" } };
            Utilities.AddRequiredParameter(parameterList, "eid", eid);
            Utilities.AddJSONArray(parameterList, "uids", uids);
            Utilities.AddOptionalParameter(parameterList, "personal_message", personalMessage);

            if (isAsync)
            {
                SendRequestAsync<events_invite_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted<bool>(callback), state);
                return true;
            }

            var response = SendRequest<events_invite_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? false : response.TypedValue;
        }

 

public bool Invite(long eid, List<long> uids, string personalMessage)
        {
            return Invite(eid, uids, personalMessage, false, null, null);
        }

 

And I'm calling it like this:

facebookApi.Events.Invite(eventId, new List<long>() {uid},
                                                                    "This is your personal message");

Miklos

Mar 4, 2010 at 10:04 AM

Hi Miklos,

Thanks for your code. Its working fine but response is "false" after the invites are sent out.

I have done the almost same thing but some modifications i did according to your code. But I am getting Permission error for invitate method. If i give my user id application is working and sending invitation to me. If i give others id iam getting permission error. How can i force the user to give permission for invitation. Please help me regarding this.

Thanks in advance,

Ibrahim.

Aug 6, 2010 at 1:39 PM

Hi,

can anyone explain how to use XSD2CodeSourceExtension.cs with the developer toolkit. I just downloaded the libraries and there seems not to be such a file or class inside.
Do I have to use the source code download?

Are there any news when the Events.Invite function will be integrated in the toolkit?

 

Thanks.

 

Patrick

Nov 24, 2010 at 8:51 AM

I also need help....My code as below: 

FacebookSession sess = oldRestAuthentication();

Events eve = new Events(sess);

List<string> userIDs = new List<string>();            

userIDs.Add(userID);            

var parameterList = new Dictionary<string, string> { { "method", "facebook.events.invite" } };   

Utilities.AddRequiredParameter(parameterList, "eid", eventID);            

Utilities.AddJSONArray(parameterList, "uids", userIDs);            

Utilities.AddOptionalParameter(parameterList, "personal_message", "Come to join us");
string result = eve.SendRequest(parameterList);

Return the following error:

Object reference not set to an instance of an object.:

Which object instance does not created?