question

Kyle MacDonald avatar image
Kyle MacDonald asked

Imported Postman Collection does not contain the correct headers.

Hello,

I just imported the postman collection following the instructions located here:

https://docs.microsoft.com/en-us/gaming/playfab/sdks/postman/postman-quickstart

I see the note about content-type of the body not being properly set to json, which is fine.

However, I am getting 401 on all requests and when I look at the headers for the request I do not have `X-Authorization` and `X-SecretKey` header on any of my requests.

I could probably tack them on in the Pre-request script but I would be nice if the import took care of that automatically.

I can see them defined in the postman JSON file. However, it looks like they are passed in as a single string with new line separators instead of going in as an array of items. I'm not an expert on this, but it looks like that might be an issue. Here is the first example that I see:

"header": [
             "X-PlayFabSDK: PostmanCollection-0.135.211209\nContent-Type: application/json\nX-SecretKey: {
                {SecretKey}}\n"
          ],

I am currently using Postman v9.9.3.

apis
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.

Kyle MacDonald avatar image Kyle MacDonald commented ·

FYI, When i manually input the x-SecretKey header all works as expected.

0 Likes 0 ·

1 Answer

·
Made Wang avatar image
Made Wang answered

Currently playfabV2.json has known issues. You can convert playfab.json to v2 version manually, it can be used normally after testing, you can refer to Importing and exporting data | Postman Learning Center to convert it.

10 |1200

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

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.