(AddSharedGroupMembers) I cannot add a member to a Shared Group via the server API I'm trying on a cloud script. Error:
"Logs": [ { "Level": "Error", "Message": "PlayFab API request error", "Data": { "api": "/ Server / AddSharedGroupMembers", "request": { "SharedGroupId": "ExistingRooms", "PlayFabIds": [ "E813B7BAD690BBE6" ] }, "result": null,
"apiError": { "code": 400, "status":
"BadRequest", "error":
"InvalidSharedGroupId",
"errorCode": 1088, "errorMessage":
"InvalidSharedGroupId",
"errorHash": null,
"errorDetails": null }
} }, { "Level": "Info", "Message": "Error: {\" cloudScriptErrorCode \ ": \" CloudScriptAPIRequestError \ ": \" stack \ ": \" Error \\ n at Object.server_request (Script Document: 176: 24) \\ n at Object. server.AddSharedGroupMembers (Script Document: 695: 78) \\ n at handlers.saveSharedDataMembers (DC66-main.js: 306: 14) \\ n at Object.invokeFunction (Script Document: 112: 33) \ ", \" apiErrorInfo \ "{\" API \ "\" / Server / addsharedgroupmembers \ ", \" request \ "{\" sharedgroupıd \ "\" existingrooms \ ", \" playfabıds \ "[\" E813B7BAD690BBE6 \ " ]}, \ "result \" nULL \ "apierr is \" {\ "code \" 400, \ "status \" \ "BadRequest \", \ "error \" \ "ınvalidsharedgroupıd \", \ "errorcode \": 1088, \ "ErrorMessage \" \ "ınvalidsharedgroupıd \", \ "errorhash \" nULL \ "errordetails \": null}}} " "Data": null } ]
What should I do? Thank you
Answer by Andy · Oct 15, 2018 at 10:02 PM
The error you're getting back, InvalidSharedGroupId, means that the data you're provding in the SharedGroupId parameter of the request is bad. If you could share the title id and the value you're passing in, I can help you validate.
Title ID: DC66
SharedGroupId: ClanMemberList
in Cloud Script:
handlers.saveSharedDataMembers = function (args) { try{
server.AddSharedGroupMembers({
SharedGroupId : args.SGDType, PlayFabIds : [args.SPI] });
server.WriteTitleEvent({ EventName : "saveSharedDataMembers" });
return { ResultCode : 0, Message: 'Success' };
}catch(e){ var msg = "Error saveSharedDataMembers: " + JSON.stringify(e); log.info(msg); } };
Did you ever call CreateSharedGroup for that group or create in the game manager? I'm not able to find it for your title, which explains the error.