Webhooks becomes invalid every 24hrs


#1

I am not sure why this happens, but approximately every 24 hours my webhook becomes invalid. To validate it again I connect to Account-Activity-Dashboard that I got from here https://github.com/twitterdev/account-activity-dashboard and validate it there using UI or terminal. After this validation my webhook becomes valid for another 24 hours and then invalid again. So basically everyday I have to manually trigger the validation by connecting to Account Activity Dashboard. I am not sure if the code I wrote for crc response token is correct or not. What should I do about this? Thanks


#2

Fixed. After playing around with my code I found the bug. I was following the code you guys provided here https://developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/guides/securing-webhooks to respond for CRC challenge and I had to change the line “return json.dumps(response)” to simply “return response” and now it all works. Not sure if it’s because of python 2.7 vs 3 or maybe something wrong on my server side. Hope someone will find this helpful for python 3.