Not getting direct message on registered webhook

api

#2

Is your webhook alive?
You can check if your webhook is alive by calling the getWebhookDetails api OR try to force a CR check .
You can get your existing webhook details by calling the following REST api

https://api.twitter.com/1.1/account_activity/webhooks.json

The response should have a field called ‘valid’.

if valid = False, then it means your webhook end point is inactive .

Regards,
Sajid


#3

I am getting valid true in response. It’s my dev environment it was working previously but when I checked it after someday it stops working. Following is my response.

[{“id”:“46546545104649216”,“url”:“https://s.rrd.example.com/msg/twitter/msg-webhook",“valid”:true,“created_timestamp”:"2017-11-21 05:3”}


#4

I have also make it live but in production, I have faced the same issue, so right now I am checking on my dev environment.


#5

I am getting valid true in response. It’s my dev environment it was working previously but when I checked it after someday it stops working. Following is my response.

[{“id”:“46546545104649216”,“url”:“https://s.rrd.example.com/msg/twitter/msg-webhook",“valid”:true,“created_timestamp”:"2017-11-21 05:3”}


#7

Can you re-enforce a CR check again ?
Try this api

PUT account_activity/webhooks/:webhook_id

Regards,
Sajid


#8

When I request with GET method to

GET https://api.twitter.com/1.1/account_activity/webhooks.json I got following response

[{“id”:“3510464921612345”,“url”:“https://s.example.com/msg/twitter/msg-webhook",“valid”:true,“created_timestamp”:"2017-11-20 05:36:51 +0000”}]

I have tried as per your suggestion request api provided by you by PUT method

PUT https://api.twitter.com/1.1/account_activity/webhooks/3510464921612345

I got the twitter page with error page doesn’t exist.

I have navigated to my setting->app and found that I have authorized the app and it’s showing on my account setting app screen.


#9

When I request with GET method to

GET https://api.twitter.com/1.1/account_activity/webhooks.json I got following response

[{“id”:“3510464921612345”,“url”:“https://s.example.com/msg/twitter/msg-webhook",“valid”:true,“created_timestamp”:"2017-11-20 05:36:51 +0000”}]

I have tried as per your suggestion request api provided by you by PUT method

PUT https://api.twitter.com/1.1/account_activity/webhooks/3510464921612345

I got the twitter page with error page doesn’t exist.

I have navigated to my setting->app and found that I have authorized the app and it’s showing on my account setting app screen.


#10

Can you guide me how can I ask a question to the Twitter developer to check/review my credentials and its permission?


#11

I guess the valid request will be
https://api.twitter.com/1.1/account_activity/webhooks/3510464921612345.JSON

Can you give a try ?


#12

Try the following steps if you can

  1. Remove your webhook end point by calling the
    DELETE
    https://api.twitter.com/1.1/account_activity/webhooks/%<YOURWEBHOOK ID%.json

Let me know if you happen to get any response .

  1. Add / Register your webhook once again…which should trigger CRC again

Lets hope it works.

Regards,
Sajid


#13

I have removed the existing registered webhook and added it again, subscribe to my webhook and BINGO…It’s done. :slight_smile:

Thanks @sajidcis


#14

Awesome…Glad it worked :slight_smile:
Regards,
Sajid


#15

Hey Sajid,

Can I make a request from postman for the same? I have written a code in PHP using CURL but it’s showing me the below response every time.

{
“errors”: [
{
“code”: 32,
“message”: “Could not authenticate you.”
}
]
}


#16

Hi …
Well…
The message is very clear that you are not authenticated.
Are u authenticating the request using OAuth 1.0 ?
Are u using the app which has been white listed for webhooks?

Regards,
Sajid


#17

If you havent authenticated your request using OAuth, then have a look at this


#18

Yes Sajid, My app is white listed and I am using oAuth 1.0.

I have a code which is in Nodejs and it’s working fine. But my PHP code is not allowing me to subscribe to my hook.

If you want to see both code please check the following link.


#19

Rahull,

Im afraid i cant be of much assistance as i dont have my technical skills in php.

Never the less,

Did u try this?

Why re-invent the wheel when you re-use stuffs?

All the best.

Regards,
Saajid


#20

Hello Saajid,

It does not matter of language which language we are using to request to webhook API. As I have to use PHP Curl for my application as per requirement, I can’t use the library provided by @abraham. I will deep dive to his library to find out that it’s also working with the Webhook API or not. I appreciate that you are helping me here to short out an issue I am facing and I am thankful for that.


#21

Hi Rahul,

Not sure what you have understood…the point was i cannot assist you in php as i dont have the skills.

As for your saying, ‘it does not matter …’…

It matters as every language has its own way of implemeting things.

For ex: Java has its own way.

Yes, the end result is the same.

All the best.

Regards,
Sajid


#22

Hi Rahul,

I faced the same issue which you have faced today .

The webhook endpoint stopped receiving messages. And the webhook was Active.

This is definitely a ‘bug’ / an issue from the Twitter end.

Regards,
Sajid