Generate Token from Power Automate

Trying to get to get bearer token using Power Automate
but getting below errors:

- Invalid id or key even if keys entered are correct
- ⁠Invalid JSON
- ⁠Cannot Read character at Line 0

Please read complete article to get solution and correct way to get token.

 Invalid Client Key or Invalid Secret key Error

- It occurs when keys entered contains special symbols
- Use encodeuri function under expression of Power Automate to convert keys in correct format and use it in body



Step1 : Select compose action
Step2: Add expression in it
Encodeuri(‘key value’)

Invalid JSON or Unable to parse JSON character

- Please check JSON formatting as mentioned below
- ⁠Use header as text/plain

- Abhijit Yewale