I tested this endpoint in Graph Explorer and it worked fine, with the following results:
It is recommended that you test in Graph Ecxplorer first, noting that the request method uses POST, and that the tokens you get can be parsed in jwt.ms to see the token permissions.
Refer to the documentation for code that uses php to send requests.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.