Hi,
First sorry because my previous response was wrong, after reviewing the documentation, the cognito api doesn't make use of the form url encoded, so you are right, it's a json string the text that must be sent in the body of the post request.
I've compiled the demo sample for cognito, with a fix for this error and you can download from:
https://www.esegece.com/download/samples/cognito.zip
Please try with this demo if the json text works for you, if works, I can provided an updated trial with this fix included.
Kind Regards,
Sergio