Sign In Register

How can we help you today?

Start a new topic

NoSQL REST API (v2) Issues

I'm struggling to use the (new) NoSQL REST API. 

#1). the API base URL does't appear to conform to the structure 

specified in the docs:


The base URL is not fixed but is dependent on the specific runtime cluster that your game is assigned to and the game stage. The structure of the base URL will always conform to this schema: https://[apiKey].cluster.[stage]





  "previewNosql": "",
  "previewElasticSearch": ""

clearly not the same form as spec'd above.

(using basic auth)

#2). All requests to the previewNosql base api result in 404s



 or any of the other requests listed here


  "message": "URI is not absolute"

 with just the basic auth header set.

I've tried using

as the base as is done if you enter your credentials on this page and hit the try buttons that appear on some of the methods, but all requests result in 404s (and a quote from Portal). 

I've also tried authorizing using X-GSAccessToken with the same results. 

Any help would be useful.

Note that I'm able to use the REST v1 API without problems. 

Hi Jordan,

You need to get the Json Web Token here. You can get that for nosql with a GET request to{apikey}/jwt/nosql

The URL is built with the peviewNosql value returned from the endpoints GET call to{apikey}/endpoints

You'll need to set the header value of X-GS-JWT to be the returned token that you got from the request above. Now when you send the request you should get a response. You don't need to use basic auth here.

We can test this now with a simple get call to return all of the collections in your game. The following URL should do this for you with a GET request.{apikey}/mongo/collections

Try that and let me know if you have any further questions. I've edited your original post to obscure your api key for security reasons.



1 person likes this

Thanks! That X-GS-JWT was what I was missing. All set now. 

Hi Jordan,

No problem. Glad to hear it's working for you now !



Login to post a comment