Allows a player's internal profile to be disconnected from an external system to which it is linked. Any friends linked as result of this connection will be removed.

View interactive version here

Request Parameters

Parameter Required Type Description
systemId No string The external system from which to disconnect this profile, supplied as a two letter ID. The options are: {FACEBOOK:FB, AMAZON:AM, GAME_CENTER:GC

Response Parameters

A response to a SocialDisconnectRequest

Parameter Type Description
scriptData ScriptData A JSON Map of any data added either to the Request or the Response by your Cloud Code

Nested types


A collection of arbitrary data that can be added to a message via a Cloud Code script.

Parameter Type Description
myKey string An arbitrary data key
myValue JSON An arbitrary data value.

Error Codes

Key Value Description
systemId REQUIRED A systemId from which to disconnect must be provided
systemId NOT_CONNECTED The player does not have a connection with the provided system.
userName CHANGE_REQUIRED If the player's userName was derived from the profile they are disconnecting from, they must change it before they can disconnect. The userName can be changed via a ChangeUserDetailsRequest.
password NOT_SET Before disconnecting, if the player has no other connected profiles then they must have a password set in order to be able to authenticate in the future. A password can be set via a ChangeUserDetailsRequest.

Code Samples


    using GameSparks.Api;
    using GameSparks.Api.Requests;
    using GameSparks.Api.Responses;
    new SocialDisconnectRequest()
        .Send((response) => {
        GSData scriptData = response.ScriptData;

ActionScript 3

    import com.gamesparks.*;
    import com.gamesparks.api.requests.*;
    import com.gamesparks.api.responses.*;
    import com.gamesparks.api.types.*;

        .send(function(response:com.gamesparks.api.responses.SocialDisconnectResponse):void {
        var scriptData:ScriptData = response.getScriptData(); 


    #import "GS.h"
    #import "GSAPI.h"
    GSSocialDisconnectRequest* request = [[GSSocialDisconnectRequest alloc] init];
    [request setSystemId:systemId;
    [request setCallback:^ (GSSocialDisconnectResponse* response) {
    NSDictionary* scriptData = [response getScriptData]; 
    [gs send:request];


    #include <GameSparks/generated/GSRequests.h>
    using namespace GameSparks::Core;
    using namespace GameSparks::Api::Responses;
    using namespace GameSparks::Api::Requests;

    void SocialDisconnectRequest_Response(GS& gsInstance, const SocialDisconnectResponse& response) {
    GSData scriptData = response.getScriptData(); 

    SocialDisconnectRequest request(gsInstance);


import com.gamesparks.sdk.api.autogen.GSRequestBuilder.SocialDisconnectRequest;
import com.gamesparks.sdk.api.autogen.GSResponseBuilder.SocialDisconnectResponse;
import com.gamesparks.sdk.api.autogen.GSTypes.*;
import com.gamesparks.sdk.api.GSEventListener;

    .send(new GSEventListener<SocialDisconnectResponse>() {
        public void onEvent(SocialDisconnectResponse response) {

Cloud Code

    var request = new SparkRequests.SocialDisconnectRequest();
    request.systemId = ...;
    var response = request.Send();

var scriptData = response.scriptData;