I am having AWS Root User credentials. I have created 5 users through https://console.aws.amazon.com/iam/home?region=us-east-1#/users -> Add User. Out of 5 (2 Programmatic User and 3 AWS Management Console access users).
How can I find all 5 user's Canonical Id or Mail Id, through Java API or https End Point using Root User's Credentials?
Sadly you can't do this. This is because Canonical user ID is the ID for the entire account, not individual IAM users:
To get it for the account, you can use CLI or any equivalent in SDK: