接收到webhook后,PHP文件不会执行JavaScript XMLHttpRequest,但会在浏览器中执行

I set up a Trello webhook that sends a POST request to mywebsite.com/webhook.php every time an action is taken within my Trello board. Right now, my goal when receiving these requests is simply to use Trello's REST API (for now just manually inputting the key and token) to create a list in my Trello board just to verify that I'm able to do so. What I have in my webhook.php file is the following:

<?php

echo '<script type="text/javascript">',
     'var xhr = new XMLHttpRequest();',
     "xhr.open('POST', 'https://api.trello.com/1/lists?name=[NAME]&idBoard=[ID]&key=[KEY]&token=[TOKEN]');",
     'xhr.send();',
     '</script>';
?>

The problem is that while this works if I simply enter in the URL mywebsite.com/webhook.php in my browser, it doesn't work when called from the Trello webhook (I've verified that the webhook is actually being received). I tested the URL in Postman and it returns 200 status but it similarly doesn't actually create a list in Trello.

I'm not quite sure where to go from here; any help would be greatly appreciated.