Setting up rest api between sage and internal application

What are the necessary steps to successfully authenticate and receive the access token from Sage X3?

Any documentation and guidance would be appreciated.