Delete endpoint with Account Activity API doesn't work

account-activity

#1

Hi,

I’ve had issues using this endpoint below and it looks like an issue from Twitter’s end:

DELETE account_activity/all/:env_name/webhooks

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

It gives a page does not exist error seen below:

404:The URI requested is invalid or the resource requested, such as a user, does not exist. Also returned when the requested format is not supported by the requested method.
message - Sorry, that page does not exist
code - 34

Is this endpoint wrong? By the way, I’m able to CREATE and GET the webhook.

FYI @andypiper


#3

@LeBraat @KyleW can you kindly take a look at this?


#4

Hey @sao_ademola - The URL you should be sending the DELETE to is:

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

We can work to make sure the docs are updated, if that is not the correct route in the docs :slight_smile:


#5

That worked! Thanks so much@KyleW

The docs surely would make things easier.


#6

@KyleW can you kindly confirm the URL for update of a webhook

This doesn’t work for a PUT:

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


#7

Are you trying to add a new webhook after deleting one? That URL is the correct one. Here is the sample curl command to POST a webhook URL:

$ curl --request POST 
 --url 'https://api.twitter.com/1.1/account_activity/all/env-beta/webhooks.json?url=https://www.kylesAwesomeSite.com/webhook' 
 --header 'authorization: Bearer TOKEN'

It is important to note, you can only have a single webhook URL per environment. If you are still running into an errors, please be sure to post the error message that is being returned as well as the full URL you are calling.


#8

Thanks for the response @KyleW

I’m trying to UPDATE a webhook should it be marked as invalid which is a PUT request to the endpoint.

The URL specified in the docs is:

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


#9

I see - that route is:

https://api.twitter.com/1.1/account_activity/all/:env_name/webhooks/:webhook_id.json"

404 returned on PUT account_activity/all/:env_name/webhooks
#11

Thanks @KyleW

You are the best!


#12

Ran into this as well. It still is not correct in the docs :stuck_out_tongue: (specifically the re-validate CRC Token endpoint)