Sign In Register

How can we help you today?

Start a new topic

Problems using REST API for Game Management

Hello! I'm trying to use the REST APIs to automate managing my game, and am running into a very odd problem.


Here's a snippet showing what would appear to be a successful API call to createSnapshot:


 

POST /restv2/game/[REDACTED]/manage/snapshots HTTP/1.1
Host: config2.gamesparks.net
Accept: application/json
Content-Type: application/json; charset=utf-8
Content-Length: 25
X-GSAccessToken: [REDACTED]
Connection: keep-alive

{"description":"Wobble"}
HTTP/1.1 201 Created
X-GS-RID: B9104DF9696125BD2059AD382C0D44282D40
Content-Type: application/json;charset=utf-8
Connection: close
Strict-Transport-Security: max-age=15768000
Set-Cookie: mesosphere_server_id=f6d1c94f0e; path=/

{"id":"59ad383046e0fb0001bb5a4f","date":1504524336113,"description":"Wobble","published":false}

As you can see, I seem to have succeeded, I get the 201 HTTP status code that should indicate a successful request. However, the snapshot doesn't appear in the list of snapshots associated with my game on the GameSparks Portal, and I attempts to GET /restv2/game/[REDACTED]/admin/snapshots/[value of "id" field in response] with suitable "X-GSAccessToken" return a 404 status.

What in the world is going on? This is very confusing.

 


David,


    There are 2 different flavors of snapshots that GS exposes - one is to snapshot the game config (cloud code, properties, etc) and the other is to snapshot the screens/snippets that are found under the 'Manage' screen.   You are creating a 'Manage' snapshot.  


The config snapshot url is https://config2.gamesparks.net/restv2/game/{0}/admin/snapshots

while the manage snapshot url is:

https://config2.gamesparks.net/restv2/game/{0}/manage/snapshots/


See:
https://docs.gamesparks.com/documentation/manage/creating-and-managing-screen-snapshots.html
https://docs.gamesparks.com/api-documentation/rest-apis/game-admin.html#/snapshots
vs
https://docs.gamesparks.com/documentation/key-concepts/snapshots.html

https://docs.gamesparks.com/api-documentation/rest-apis/game-admin.html#/manage

best of luck!!


Jeff


1 person likes this
Thanks, Jeff! Yes, that seems to have been the issue.
Login to post a comment