Ahmy
Ahmy

Reputation: 5480

How can I send an invitation request using the Facebook API?

I would like to send an invitation request from my Facebook application written in C#.

Here is what I tried:

_fbService.API.notifications.sendEmail(DataList1.DataKeys[e.Item.ItemIndex].ToString(),"Invitation to play a game", "You are invited to play the game","");

This does not work, it only sends a notification, not a request.
What am I doing wrong?

Upvotes: 5

Views: 11365

Answers (1)

Ajw
Ajw

Reputation: 716

If you are asking how you can send invitations to users who have not authorized your application (i.e. not inviting your application users to use a new feature or participate in an activity), then you can't with the API.

From the API documentation - Notifications.sendEmail:

Sends an email to the specified users, who have both authorized your application and granted it the email extended permission.

The API function that did allow this was Notifications.sendRequest but it has been disabled, perhaps due to consideration of abuse and security. See the documentation for the alternative.

Upvotes: 4

Related Questions