/// <summary> /// Retrieves the entity's profile. /// </summary> public static void GetProfiles(GetEntityProfilesRequest request, Action <GetEntityProfilesResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null) { var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer; PlayFabHttp.MakeApiCall("/Profile/GetProfiles", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context); }
/// <summary> /// Retrieves the entity's profile. /// </summary> public void GetProfiles(GetEntityProfilesRequest request, Action <GetEntityProfilesResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null) { var context = (request == null ? null : request.AuthenticationContext) ?? authenticationContext; var callSettings = apiSettings ?? PlayFabSettings.staticSettings; if (!context.IsEntityLoggedIn()) { throw new PlayFabException(PlayFabExceptionCode.NotLoggedIn, "Must be logged in to call this method"); } PlayFabHttp.MakeApiCall("/Profile/GetProfiles", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context, callSettings, this); }
/// <summary> /// Retrieves the entity's profile. /// </summary> /// <param name="DataAsObject">Determines whether the objects will be returned as an escaped JSON string or as a un-escaped JSON object. Default is JSON string. (Optional)</param> /// <param name="Entities">Entity keys of the profiles to load. Must be between 1 and 25 (Required)</param> public static Task <GetEntityProfilesResponse> GetProfiles(List <EntityKey> Entities, bool?DataAsObject = default, PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null) { GetEntityProfilesRequest request = new GetEntityProfilesRequest() { Entities = Entities, DataAsObject = DataAsObject, }; var context = GetContext(customAuthContext); return(PlayFabHttp.MakeApiCallAsync <GetEntityProfilesResponse>("/Profile/GetProfiles", request, AuthType.EntityToken, customData, extraHeaders, context)); }
/// <summary> /// Retrieves the entity's profile. /// </summary> public void GetProfiles(GetEntityProfilesRequest request, Action <GetEntityProfilesResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null) { PlayFabHttp.MakeApiCall("/Profile/GetProfiles", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, false, authenticationContext, ApiSettings); }
/// <summary> /// Retrieves the entity's profile. /// </summary> public static async Task <PlayFabResult <GetEntityProfilesResponse> > GetProfilesAsync(GetEntityProfilesRequest request, object customData = null, Dictionary <string, string> extraHeaders = null) { if ((request?.AuthenticationContext?.EntityToken ?? PlayFabSettings.staticPlayer.EntityToken) == null) { throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call GetEntityToken before calling this method"); } var httpResult = await PlayFabHttp.DoPost("/Profile/GetProfiles", request, "X-EntityToken", PlayFabSettings.staticPlayer.EntityToken, extraHeaders); if (httpResult is PlayFabError) { var error = (PlayFabError)httpResult; PlayFabSettings.GlobalErrorHandler?.Invoke(error); return(new PlayFabResult <GetEntityProfilesResponse> { Error = error, CustomData = customData }); } var resultRawJson = (string)httpResult; var resultData = PluginManager.GetPlugin <ISerializerPlugin>(PluginContract.PlayFab_Serializer).DeserializeObject <PlayFabJsonSuccess <GetEntityProfilesResponse> >(resultRawJson); var result = resultData.data; return(new PlayFabResult <GetEntityProfilesResponse> { Result = result, CustomData = customData }); }