Sign In Register

How can we help you today?

Start a new topic

REST API Snapshot limiting

Hello,


I'm having an issue where if I make the api call to get the list of my snapshots it will take ages to return something because I have a lot of snapshots made on my game environment. (And 99% of the time I will only need the latest one)


Is there a possibility to request a specific number of snapshots or the latest few or anything of the sorts?


Thank you!


Regards,

Mike :D


1 person likes this idea

Hi Mike


What are you using to call the rest API?


Regards

Katie

Hi,


I'm using the Snapshot REST API call to list snapshots: "GET: /rest/games/{gameApiKey}/snapshot/list"

I only, ideally, need the latest one so I can copy it over different environments.


Thanks.


Bump?

Hi Mike, 


How long is it taking for the list of snapshots list to come back ? I have roughly the same amount in a test game of mine and they come back instantly without issue. I don't believe it's possible to limit the amount in the response currently. The latest snapshot is always returned first.


Thanks,

Liam

Hi,

We've just stopclocked it and it took about 7 seconds to get the whole list. That's....quite some time by normal standards. Especially since in our use case we just need the latest one (aka the first one in the array). It would be really useful to either have a separate call that returns the most recent one or provide another param to the already existing call to limit the number of snapshots we want.


Thanks. :)

Hi Mike,


Yes that is quite slow alright, what are you using to send your REST call ? Postman, Curl ? I'll look into this some more for you.


Thanks,

Liam

Hi Liam,


We wrote a tiny editor tool for Unity that automates snapshot copying and it uses the UnityEngine WWW class (https://docs.unity3d.com/ScriptReference/WWW.html) to make the calls.


Thanks for the help! :)


Regards,

Mike :D

Hi Mike,


Can you try this in Postman or Curl to see if it the issue is with the tool you've created ? I've tested this again with Postman in a game with a lot of snapshots and they come back straight away.


Thanks,

Liam

Login to post a comment