Authenticate
Xray itself provides a REST API with endpoints specifically made for dealing with test management.
Requests made to Xray's REST API must be authenticated using a client id and a client secret, which in turn are based on an API Key created for some user in Xray Global Settings: API Keys global settings.
Thus, the first step you need to do is obtaining a token based on the Client Id and Client Secret of your assigned API Key. From thereon, you can use it to make whatever requests to Xray Cloud.