Going through tutorial but I get the error:
“ScriptError (422) HTTP/1.1 422 Unprocessable Entity
Unprocessable Entity
Invocation Error
ScriptRunner.Exceptions.CloudCodeRuntimeException: Error executing Cloud Code function. Exception type: KeyNotFoundException. Message: Key QUESTS not found in Remote Config settings” on this line:
var result = gameApiClient.RemoteConfigSettings.AssignSettingsGetAsync(ctx, ctx.AccessToken, ctx.ProjectId,
ctx.ProjectId, null, new List { “QUESTS” });
Then I checked many times, and actually, it works if I add the same “QUESTS” JSON to the “Production” environment. But how to make it work in other environments? Did I miss something?
Thank you.
Hi @Kurutah
I see theres actually an error in the sample there as the projectId is being passed twice, but the environmentId isn’t, I believe the code snippet should be the following:
var result = gameApiClient.RemoteConfigSettings.AssignSettingsGetAsync(ctx, ctx.AccessToken, ctx.ProjectId,
ctx.EnvironmentId, null, new List<string> { "QUESTS" });
When I get a chance I’ll try it out but if that resolves your issue then I will get the documentation updated.
Thank you, just found it out myself too. Yes, it works.
Btw, another mistake for some newbies like me is the right format for JSON from the same page is:
{
“statements”: [
{
“Sid”: “deny-cloud-save-data-write-access”,
“Effect”: “Deny”,
“Action”: [“Write”],
“Principal”: “Player”,
“Resource”: “urn:ugs:cloud-save:/v1/data/projects//players//items**”
}
]
}
I spent much time trying to make work JSON from the page and it just doesn’t
2 Likes
Thanks for reporting those documentation issues @Kurutah The documentation should hopefully get updated soon.
1 Like