question

Desmo avatar image
Desmo asked

Create Matchmaking Ticket - Bad Request, Invalid input parameters.

Hi, I'm new here on PlayFab, I think it's an awesome framework :)

I'm using Unreal engine and I'm just trying to create a matchmaking ticket, entirely in BluePrint...

After login into my player account, this is what i get when I try to create a matchmaking ticket (from Unreal Log):

LogPlayFab: Response : 
{ 
"code": 400,
"status": "BadRequest",
"error": "InvalidParams",
"errorCode": 1000,
"errorMessage": "Invalid input parameters",
"errorDetails": 
{ "EntityKey": ["Type or TypeString is required.", "Id is required.", " is not an allowed value of Type."]}
}
LogBlueprintUserMessages: [UMG_MainMenu_C_0] Invalid input parameters LogBlueprintUserMessages: [UMG_MainMenu_C_0] EntityKey: Type or TypeString is required. EntityKey: Id is required. EntityKey: is not an allowed value of Type.

..and this is the passed in JSON (from unreal log):

LogPlayFab: Request: {
    "Creator":
    {
        "Entity":
        {
            "Id": "XXXD8D8XXXED0XXX", (<-masked PalyFab Id - master player account Id)
            "Type": "master_player_account"
        }
    },
    "GiveUpAfterSeconds": 60,
    "MembersToMatchWith": [
        {
        }
    ],
    "QueueName": "MatchMaker1"
}

...the message <<", " is not an allowed value of Type.">> makes me think of a malformed JSON. But it seems to be well formed instead.

So, I think the culprit could be "MembersToMatchWith" that is a mandatory parameter, but I don't want to create a multiple user ticket, just a single user ticket...

So, what am I doing wrong? :(

Thank you in advance!

apissdksTitle Data
10 |1200

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

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

MembersToMatchWith field in the CreateMatchmakingTicket request can be left as null to request a single user’s ticket. In the Unreal 4 Blueprints editor, you can [Promote to variable] for it. The variable would be null by default. Besides, the Entity type of Creator should be “title_player_account” in such title-targeted API requests, “master_player_account” is not suitable for such types of operations. Please refer to the following Output log of UE4.

LogPlayFab: Request: {
    "Creator":
    {
        "Entity":
        {
            "Id": "[PlayFabUserTitleId]",
            "Type": "title_player_account",
            "TypeString": "title_player_account"
        }
    },
    "GiveUpAfterSeconds": 60,
    "MembersToMatchWith": null,
    "QueueName": "[YourQueueName]"
}
3 comments
10 |1200

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

Desmo avatar image Desmo commented ·

Hi @Sarah Zhang,

I couldn't thank you enough, I just did it, thanks to your advice. I was completely wrong, sometimes I feel not quiet confident with API References, I mean, well documented I know, but with missing details sometimes. In my case was the difference between Master and Title Player Id.

Maybe it's only because it's my first project using PlayFab.

Thank you again!!!

0 Likes 0 ·
Desmo avatar image Desmo commented ·

Hi Sarah,

I couldn't thank you enough, I just did it, thanks to your advice. I was completely wrong, sometimes I feel not quiet confident with API References, I mean, well documented I know, but with missing details sometimes. In my case was the difference between Master and Title Player Id.

Maybe it's only because it's my first project using PlayFab.

Thank you again!!!

0 Likes 0 ·
Mathieu Deletrain avatar image Mathieu Deletrain commented ·

Hi !

I see you are using the user's title id to construct the entity key.

I used to ensure entity key was correct by first calling GetEntityToken which effectively returns me the user title id.

Is that safe to skip that step ?

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.