To use Rest API you need that the user has the following permission:
- "Public API access". (see here for more information)
To configure user permissions:
- Connect to XenMobile Portal
- Go to settings and select Role-based Access Control
- Expand one of the user to see these permissions