An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
A returned message ID does not confirm that the message reached your personal Messenger inbox; for supported delivery, send through a Facebook Page to your personal account’s Page-scoped ID after that account has first messaged the Page.
Supported test procedure
- From your personal Facebook account, open the Page in Messenger and send it a message.
Messenger requires the recipient to initiate the conversation before the Page can reply. - Obtain that personal account’s Page-scoped ID (PSID) from the Page’s conversation/webhook data.
- Send to the PSID—not the Page ID, profile ID, or
session.user.uid—using:-
POST /<PAGE_ID>/messages - A Page access token
- The appropriate
messaging_type -
recipient.idset to the PSID
-
- Check the conversation in Messenger, not merely the Facebook profile page.
A successful Send API response contains both recipient_id and message_id; the recipient must be a valid PSID associated with the Page conversation.^1^
A minimal C# request has this shape:
using var client = new HttpClient();
var body = new {
recipient = new { id = recipientPsid },
messaging_type = "RESPONSE",
message = new { text = "Test message" }
};
var response = await client.PostAsJsonAsync(
$"https://graph.facebook.com/{pageId}/messages?access_token={pageToken}",
body);
string result = await response.Content.ReadAsStringAsync();
Console.WriteLine($"{(int)response.StatusCode}: {result}");
response.EnsureSuccessStatusCode();
Keep the Page access token out of source control and logs.
Why the current library result is inconclusive
The FBClient_Simple sample belongs to the third-party fbchat-sharp project and creates a thread using session.user.uid before calling sendText. Its send implementation also creates local/offline message identifiers while processing Facebook’s response. Consequently, the text FB Message sent with ID: ... should not be treated as proof that Messenger accepted and delivered the message.
The available repository history shows its latest listed commits were in June 2022, while reported receive-event failures also exist in its issue tracker.^2^ This does not prove the same failure here, but it means compatibility with Facebook’s current private endpoints cannot be assumed.
Since the program already returns an ID, the next useful diagnostic is to log the complete HTTP status and response body produced by the send operation, with cookies and tokens redacted. Do not only test whether the returned string is non-null. In .NET, HTTP failures must be detected from IsSuccessStatusCode or EnsureSuccessStatusCode; HttpClient does not necessarily throw merely because the server returned an error response.^3^
If FBClient_Simple does not expose the raw response, add temporary logging around the underlying PostAsync/SendAsync call:
using HttpResponseMessage response = await client.SendAsync(request);
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine($"HTTP {(int)response.StatusCode}");
Console.WriteLine(responseBody); // Redact tokens/cookies before sharing
if (!response.IsSuccessStatusCode)
throw new HttpRequestException(responseBody);
If the response contains no server-issued recipient/thread confirmation, the displayed ID is insufficient evidence of acceptance. If the library depends on undocumented personal-account endpoints, there is no supported C# repair established here; replace that path with the Page-based Messenger Platform flow above.
References