profile.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:sarafu 作者: pesaply 项目源码 文件源码
def webhook(request):
    webhook_secret = 'YOUR_WEBHOOK_SECRET_HERE'

    if request.POST.get('secret') != webhook_secret:
        return HttpResponse("Invalid webhook secret", 'text/plain', 403)

    if request.POST.get('event') == 'incoming_message':
        content = request.POST.get('content')
        from_number = request.POST.get('from_number')
        phone_id = request.POST.get('phone_id')

        # do something with the message, e.g. send an autoreply            

        return HttpResponse(json.dumps({
            'messages': [
                {'content': "Thanks for your message!"}
            ]
        }), 'application/json')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号