OK, I am now reading codes of https://github.com/twitterdev/Account-Activity-dashboard and I now know that
The request should be performed with a "Content-Type application/x-www-form-urlencoded" header and a form including a key url and a value YOUR WEBHOOK ENDPOINT, and so should not include them as a url parameter!
This is very different from what the documents says here!!
It should be like this:
curl --request POST \
--url https://api.twitter.com/1.1/account_activity/all/env_beta/webhooks.json \
--header 'authorization: OAuth oauth_consumer_key="CONSUMER_KEY", oauth_nonce="GENERATED", oauth_signature="GENERATED", oauth_signature_method="HMAC-SHA1", oauth_timestamp="GENERATED", oauth_token="ACCESS_TOKEN", oauth_version="1.0"' \
--header 'content-type: application/x-www-form-urlencoded' \
--data url=ENCODED_WEBHOOK_URL
but NOT this:
$ curl --request POST \
--url 'https://api.twitter.com/1.1/account_activity/all/:ENV_NAME/webhooks.json?url=https%3A%2F%2Fyour_domain.com%2Fwebhook%2Ftwitter'
--header 'authorization: OAuth oauth_consumer_key="CONSUMER_KEY", oauth_nonce="GENERATED", oauth_signature="GENERATED", oauth_signature_method="HMAC-SHA1", oauth_timestamp="GENERATED", oauth_token="ACCESS_TOKEN", oauth_version="1.0"'
and now I get a 401 “Could not authenticate you” error 32.
This is a big leap because now it is same in both All Access and DM Access. I’m looking into other issues continuously.