@andypiper
Actually after posting the question, I’ve found this topic and commented it here, will not repeat this again. Also, we have created the environment with the name dev , and deleted it and created another one with different name but facing the same issue.
// twitter authentication
$twitter_oauth = [
'consumer_key' => COSUMER_KEY,
'consumer_secret' => CONSUMER_SECRET,
'oauth_access_token' => ACCESS_TOKEN,
'oauth_access_token_secret' => ACCESS_TOKEN_SECRET,
];
// request URL
$url = "https://api.twitter.com/1.1/account_activity/all/codesigmadev/webhooks.json?url=" . rawurlencode('https://mydomain.com/tsmctrl/webhook.php') . "";
// request method
$requestMethod = 'POST';
$twitter = new TwitterAPIExchange($twitter_oauth);
// POST request to create webhook
$webHook = $twitter->buildOauth($url, $requestMethod)->performRequest();