Hi, can you help me? Following this example I modified it and it shows me a json sha- but it says that the next step is to subscribe the webhooks to the events but not what to do that code to put?

Hey @oscar00719 - You need to subscribe your webhook URL to users activities using the POST account_activity/all/:env_name/subscriptions endpoint. You can read about this in the libraries read me here:

Add user subscription.
python example_scripts/subscribe-account.py

I’m not sure what your specific question is here, as the wording is somewhat broken. Can you please rephrase your question?

Hello LeBraat , I already read the endpoint that you mention to me, my query is at what moment I have to execute this request, it is executed once or several times, and if it would be in my authentication method I share the screen.

The code that you provided me looks to be registering a webhook URL, not subscribing to a user’s activity.

My apologies, but I’m not quite sure what you are trying to do.

Correct and I register, my question is how I subscribe for my webhooks to work. I do not know how to do it?

https://api.twitter.com/1.1/account_activity/all/:env_name/subscriptions.json

this would have to create a new .py file that carries that url oh I would have to go in my get method that’s my question?

In this file, you are going to have to add the access tokens that you generate using the 3-legged oauth flow for the user in question.

In step 2 of the 3-legged oAuth flow, just make sure that the user that you’d like to subscribe to signs in to effectively authorize you to make requests on behalf of them. The result of the 3-legged oAuth flow is the set of access tokens that you will then use in the subscribe-account.py file.

1 Like

I understand that but as I call it that file would be from here https://3d25014b.ngrok.io/webhooks, oh how is that where I’m lost?

I’m sorry I’m asking so much but I have 2 weeks that I do not stop here and I read several documents on twitter and I do not understand. thank you for answering me

Hello @LeBraat I did what you told me and I get this error I do not know what I’m doing wrong when I execute it.

@andypiper can you help me please

Please don’t tag staff members who aren’t currently engaged with you in any given topic.

Our team is distributed around the globe and we may not always be able to answer a question quickly. We have different schedules and sometimes it may take a few days. Thanks for your patience! This is a community forum, not a direct channel to technical support.

What is the full resource URI that you are using?

@LeBraat Hello I’m sorry for tagging someone else, I have these two files the Main is the one I have running, when I run the register-webhook.py I get back that json I can not do what is a subscription I do not step there and I have two semans already revice the forums and I do not step out of there.

I apologize. The english here is pretty broken and I’m not quite sure what is going on here. Can you please try to restate the issue?

@LeBraat I have those two files running Main.py which is my webhooks and I have the method that CRC validates, when I run register-webhooks it gives me this error,

Hi @LeBraat when I run this in my browser I can see the request token that’s what I read my webhook is already registered, now the next step is to subscribe my webhook to start receiving events but when I execute the subscribe-webhook.py file I receive the following error I do not understand because I share screen capture of how I do it.

You actually don’t need to pass the url parameter with that endpoint. Have you tried passing it without that parameter?

You can see an example cURL requests in our documentation if you need to see an example.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.