question

Jørgen Havsberg Seland avatar image
Jørgen Havsberg Seland asked

AddGenericID request fails with 1000: InvalidParams

I'm sending the following request:

ClientModels::FAddGenericIDRequest:
  AuthenticationContext	
    ClientSessionTicket "xxxxxxxxxxxxxxxx---xxxxx-xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx="
    EntityToken "xxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxx"
    DeveloperSecretKey	Empty	
    PlayFabId	L"xxxxxxxxxxxxxxxx"
  GenericId	
    ServiceName "NULL_OSS" 
    UserId "xxxxxxxx-xxx-41C210B04FE4CDBBEF4523939C8384C5"

It fails with error code 1000. Is there anything obviously wrong with the GenericID? Is it violating some undocumented constraint, perhaps? Does the ServiceName have to be setup somewhere first before it can be used in the AddGenericID call?

I'm asking because other API calls surrounding this call succeed, so there seems to be nothing wrong with the authentication context.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jørgen Havsberg Seland avatar image
Jørgen Havsberg Seland answered

The problem was that our PlayFab SDK was really old. In this version, the error details were hidden by the Unreal PlayFab API. The newest version of the SDK does NOT have this limitation.

bool PlayFabRequestHandler::DecodeError(TSharedPtr<FJsonObject> JsonObject, PlayFab::FPlayFabCppError& OutError)
{
    // check if returned json indicates an error
    if (JsonObject->HasField(TEXT("errorCode")))
    {
        // deserialize the FPlayFabCppError object 
        JsonObject->TryGetNumberField(TEXT("errorCode"), OutError.ErrorCode);
        JsonObject->TryGetNumberField(TEXT("code"), OutError.HttpCode);
        JsonObject->TryGetStringField(TEXT("status"), OutError.HttpStatus);
        JsonObject->TryGetStringField(TEXT("error"), OutError.ErrorName);
        JsonObject->TryGetStringField(TEXT("errorMessage"), OutError.ErrorMessage);


        // TODO: handle error details properly
        //"errorDetails"


        // TODO: handle global error delegate here


        // We encountered no errors parsing the error
        return true;
    }
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Citrus Yan avatar image
Citrus Yan answered

Referring to the Client/AddGenericID API reference: https://docs.microsoft.com/en-us/rest/api/playfab/client/account-management/addgenericid?view=playfab-rest#genericserviceid, PlayFabId is not required in the request body, hence you’ll need to omit that from your request. And, please also note that Server/AddGenericID requires PlayFabId in the request body, which is the main difference between the Server and Client AddGenericID API.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jørgen Havsberg Seland avatar image Jørgen Havsberg Seland commented ·

Please note the PlayFabId in the above except is part of the AuthenticationContext assembled by the PlayFab API during login, and is outside my control.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.