Click or drag to resize

IFBMessengerSendViaPhoneNumber Method

Send a message to a user in Facebook Messenger assuming they have linked their phone number with their Facebook account. Including the optional first or last name will increase the odds of a successful match.

Namespace:  NetQuarry.Services.Facebook
Assembly:  EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax
string SendViaPhoneNumber(
	string phoneNumberE164,
	string message,
	string messageTag = null,
	string firstName = null,
	string lastName = null
)

Parameters

phoneNumberE164
Type: SystemString
The users phone number in E.164 format. For example, the US phone number (714) 123-4567 in E.164 format is +17141234567
message
Type: SystemString
The message content (plain text)
messageTag (Optional)
Type: SystemString
A tag that identifies the type of message. See Facebook Message Tags
firstName (Optional)
Type: SystemString
Optional first name to aid in matching to the correct Facebook user
lastName (Optional)
Type: SystemString
Optional first name to aid in matching to the correct Facebook user

Return Value

Type: String
The ID of the message sent.
Exceptions
ExceptionCondition
FBApiException Thrown when Facebook returns an error. See https://developers.facebook.com/docs/messenger-platform/reference/send-api/error-codes for details on the possible error types and codes.
See Also