Method: scores.submit
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ส่งคะแนนไปยังลีดเดอร์บอร์ดที่ระบุ
คำขอ HTTP
POST https://games.googleapis.com/games/v1/leaderboards/{leaderboardId}/scores
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
leaderboardId |
string
รหัสของลีดเดอร์บอร์ด
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
language |
string
ภาษาที่ต้องการใช้สำหรับสตริงที่แสดงผลโดยวิธีนี้
|
score |
string (int64 format)
ต้องระบุ คะแนนที่คุณส่ง ระบบจะไม่สนใจคะแนนที่ส่งไปหากคะแนนนั้นแย่กว่าคะแนนที่ส่งไปก่อนหน้านี้ ส่วนคะแนนที่แย่กว่าจะขึ้นอยู่กับลำดับการจัดเรียงลีดเดอร์บอร์ด ความหมายของค่าคะแนนจะขึ้นอยู่กับประเภทรูปแบบลีดเดอร์บอร์ด สำหรับจุดตายตัว คะแนนจะแสดงค่าดิบ สำหรับเวลา คะแนนจะแสดงเวลาที่ผ่านไปในหน่วยมิลลิวินาที สำหรับสกุลเงิน คะแนนจะแสดงค่าในหน่วยไมโคร
|
scoreTag |
string
ข้อมูลเพิ่มเติมเกี่ยวกับคะแนนที่คุณส่ง ค่าต้องประกอบด้วยอักขระที่ปลอดภัย URI ไม่เกิน 64 ตัวตามที่กำหนดโดยส่วน 2.3 ของ RFC 3986
|
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ SubmitLeaderboardScoreResponse
ขอบเขตการให้สิทธิ์
ต้องมีขอบเขต OAuth อย่างใดอย่างหนึ่งต่อไปนี้
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/games_lite
ดูข้อมูลเพิ่มเติมได้ที่ภาพรวมของ OAuth 2.0
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# Method: scores.submit\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nSubmits a score to the specified leaderboard.\n\n### HTTP request\n\n`POST https://games.googleapis.com/games/v1/leaderboards/{leaderboardId}/scores`\n\n### Path parameters\n\n| Parameters ||\n|-----------------|-------------------------------------|\n| `leaderboardId` | `string` The ID of the leaderboard. |\n\n### Query parameters\n\n| Parameters ||\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `language` | `string` The preferred language to use for strings returned by this method. |\n| `score` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Required. The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units. |\n| `scoreTag` | `string` Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [SubmitLeaderboardScoreResponse](/games/services/web/api/rest/v1/SubmitLeaderboardScoreResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/games`\n- `\n https://www.googleapis.com/auth/games_lite`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]