Levi
Levi

Reputation: 21

Twilio Whatsapp API Sticker Support

Hey, Y'all

Im Trying to write an Whatsapp bot, which automatically will collect Stickers, send to the bot.

I wrote a simple piece of Code to anlyse each received message.

from flask import Flask, request
from dotenv import load_dotenv
from twilio.twiml.messaging_response import MessagingResponse
from twilio.rest import Client



load_dotenv()

app = Flask (__name__)
client = Client()


@app.route("/image", methods=["POST"])
def analyse():
    message_values = request.values
    print(message_values)
    r = MessagingResponse()
    return str(r)

Now, when i Send an Image or any other kind of media it send me the url of the media. as you see down below.

CombinedMultiDict([ImmutableMultiDict([]), ImmutableMultiDict([
('MediaContentType0', 'video/mp4'),
('SmsMessageSid', 'MM868e03ac085bf7a0c025cecab85d3dd2'),
('NumMedia', '1'),
('ProfileName', 'Folrin'),
('SmsSid', 'MM868e03ac085bf2a0c525cecag85d3dd2'),
('WaId', '4915735700000'),
('SmsStatus', 'received'),
('Body', ''),
('To', 'whatsapp:+14155238886'),
('NumSegments', '1'),
('MessageSid', 'SM4052281c1b19248246a03e4cda52535'),
('AccountSid', 'AC2a0b228b78a7bc249e6d34a7c498535c'),
('From', 'whatsapp:+4915735700000'),
('MediaUrl0', 'https://api.twilio.com/2010-04-01/Accounts/AC9a0f428b71a7bc649e6d34a7c498135c/Messages/MM868e03ac085bf7a0c025cecab85d3dd2/Media/MEf4e649765ae1612f5f440fbd722f6567'),
('ApiVersion', '2010-04-01')])])

The Problem is, that when I'm sending a sticker, I basically get no Url in the request.

CombinedMultiDict([ImmutableMultiDict([]), ImmutableMultiDict([
('SmsMessageSid', 'MM868e03ac085bf2a0c525cecag85d3dd2'),
('NumMedia', '0'),
('ProfileName', 'Folrin'),
('SmsSid', 'SM4052284a1x14e2da0s6a03e4cca02135'),
('WaId', '4915735700000'),
('SmsStatus', 'received'),
('Body', ''),
('To', 'whatsapp:+14155238886'), 
('NumSegments', '1'), 
('MessageSid', 'SM4052281c1b19248246a03e4cda52535'), 
('AccountSid', 'AC2a0b228b78a7bc249e6d34a7c498535c'),
('From', 'whatsapp:+4915735700000'), ('ApiVersion', '2010-04-01')])])

If anybody could explain that to me or know a better way I'm glad to get help. I don't know any further right now.

Upvotes: 0

Views: 640

Answers (1)

Levi
Levi

Reputation: 21

[SOLVED]

As it turns out aparently, the Twilio-API does not support sticker and won't support it anytime soon.

:(((

Upvotes: 1

Related Questions