sendSticker method

Future<Request> sendSticker(
  1. String phoneNumber,
  2. String mediaId
)

Implementation

Future<Request> sendSticker(String phoneNumber, String mediaId) async {
  final Map<String, String> headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer $accessToken',
  };

  final Map<String, dynamic> body = {
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": phoneNumber,
    "type": "sticker",
    "sticker": {"id": mediaId}
  };

  await request.post('$fromNumberId/messages', headers, body);
  return request;
}