question

nws1gawr avatar image
nws1gawr asked

API Call,How to Call PlayFab API leaderboard and display in HTML ?

Hi there How do I Call the PlayFab API leaderboard and display in HTML ? https://.playfabapi.com/Server/GetLeaderboard

this one always say the 404 the page not found even if I inserted my Title ID.

apisLeaderboards and Statistics
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

·
Neils Shi avatar image
Neils Shi answered

As Player Data Management - Get Leaderboard - REST API (PlayFab Server) | Microsoft Learn mentions, this API needs a “X-SecretKey” in its Request Header. And a correct request body is also required. BTW, our JavaScript SDK provides everything you need to access the PlayFab API. If you are using JavaScript, you can refer to JavaScript quickstart for Native and Phaser - PlayFab | Microsoft Learn.

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

nws1gawr avatar image nws1gawr commented ·

Is there any example that you can provide to call the API using fetch in vanilla js? There's also no proper example on calling in using POSTMAN

0 Likes 0 ·
Neils Shi avatar image Neils Shi nws1gawr commented ·

Can you tell me more about calling the API using fetch in vanilla js? The document QuickStart: PlayFab client library for JavaScript provides the code examples which can help you to call PlayFab API. If you want to call API with the Postman, you can refer to the Quickstart: PlayFab REST API collection for Postman.

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.