Hello kalimuthu,
Thank you for reaching out to Microsoft Support!
First you need to make sure that the permissions granted are correct.
if you are using delegated permissions, you also need to grant the user the appropriate role, and use Auth code flow to get the token.
If application permissions are used, client credentials flow is required.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.