Im getting output as Invalid credentials in this api even though the value that Im using are correct

MicrosoftTeams-image (55)
This is the API where we generate a token.

MicrosoftTeams-image (54)
But when we enter the values and run the API script we get an output but the output is Invalid Credentials. How can I generate a token from this script.