question

jpdoiron avatar image
jpdoiron asked

Authenticate Session Ticket - How do I use this API? (Bad Request)

Hello,

I have a backend server that has it's own web API that calls the PlayFab REST API to authenticate the player who is calling our API.

I am trying to use the PlayFab API call detailed here: https://learn.microsoft.com/en-us/rest/api/playfab/server/authentication/authenticate-session-ticket?view=playfab-rest

However, when I try this in Postman it just returns Bad Request. To test, I login to our game, get the session ticket from the login and provide that to Authenticate Session Ticket.

The session ticket looks like this: (The one I'm sharing is invalid) C1AD2D270657F2F5-117B8CDFB1A5F9E8-3AFFAE55E62A24FF-60B7D-ED5D3755E09D34E-l+GegjFZYKQcC4ZAnlFmkhf3lROY5LC68x/J6j1i+Ac=

And the secret key looks like this: (The one I'm sharing is invalid) 0Y4MLBHFBWCT2PJ5P1UFA29EULO5ONYEKB798QOIAU97UZSA11

Also the URL is this: https://60B7D.playfabapi.com/Server/AuthenticateSessionTicket

What am I doing wrong?

5495-postmanparams.png 5496-postmanheaders.png

apisAuthentication
postmanparams.png (41.4 KiB)
postmanheaders.png (46.1 KiB)
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

·
Gosen Gao avatar image
Gosen Gao answered

Please follow Quickstart: PlayFab REST API collection for Postman to import PlayFab Postman SDK.

According to your screenshot, the Request Headers should be fine, but I don't know your Request Body as you didn't enable the SessionTicket param. Usually, Request Body looks like:

 {
   "SessionTicket": "xxxxxxxx"
 }
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.

tchambers avatar image tchambers commented ·

You're right! I didn't realize I didn't enable it. I also disabled some of the hidden headers. I tried with all of them except for Content-Type (in favour of my own) and I also tried with everything turned off. And! I realized I put the SessionTicket in the params instead of the body. (I used raw/JSON for body)

It's now working thanks. All my fault.

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.