> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GET (/users/xuid({xuid})/achievements)

> GET (/users/xuid({xuid})/achievements)

# GET (/users/xuid({xuid})/achievements)

取得遊戲上定義的成就清單、使用者已解除鎖定的成就，或使用者正在進行中的成就。
這些 URI 的網域為 `achievements.xboxlive.com`。

* [URI 參數](#ID4EX)
* [查詢字串參數](#ID4ECB)
* [授權](#ID4ENF)
* [必要的要求標頭](#ID4ESG)
* [選用的要求標頭](#ID4ESH)
* [要求本文](#ID4EIBAC)
* [回應本文](#ID4ETBAC)

## URI 參數

| 參數 | 類型 | 描述 |
| - | - | - |
| xuid | 64 位元不帶正負號整數 | 要存取其 (資源) 之使用者的 XBOX 使用者識別碼 (XUID)。必須與已驗證使用者的 XUID 相符。 |

## 查詢字串參數

\| 參數| 必要| 類型| 描述|
\| --- | --- | --- | --- | --- | --- | --- |
\| **skipItems**| 否| 32 位元帶正負號整數| 傳回從指定項目數之後開始的項目。例如，**skipItems="3"** 會從擷取的第四個項目開始擷取項目。 |
\| **continuationToken**| 否| string| 傳回從指定接續權杖開始的項目。 |
\| **maxItems**| 否| 32 位元帶正負號整數| 要從集合傳回的項目數上限，可與 **skipItems** 和 **continuationToken** 合併使用以傳回某個範圍的項目。如果沒有 **maxItems**，服務可能會提供預設值，而且即使尚未傳回最後一頁結果，也可能傳回少於 **maxItems** 的項目。 |
\| **titleId**| 否| string| 傳回結果的篩選條件。接受一或多個以逗號分隔的十進位遊戲識別碼。|
\| **unlockedOnly**| 否| 布林值| 傳回結果的篩選條件。如果設定為 **true**，只會傳回使用者已解除鎖定的成就。預設為 **false**。|
\| **possibleOnly**| 否| 布林值| 傳回結果的篩選條件。如果設定為 **true**，將傳回所有可能的結果，但不傳回解除鎖定中繼資料，只會傳回來自 XMS 的成就資訊。預設為 **false**。|
\| **types**| 否| string| 傳回結果的篩選條件。可以是 "Persistent" 或 "Challenge"。預設為所有支援的類型。|
\| **orderBy**| 否| string| 指定傳回結果的順序。可以是 "Unordered"、"Title"、"UnlockTime" 或 "EndingSoon"。預設為 "Unordered"。|

## 授權

\| 宣告| 必要?| 描述| 遺漏時的行為|
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| User| 呼叫者是經過授權的 XBOX LIVE 使用者。| 呼叫者必須是 XBOX LIVE 上的有效使用者。| 403 Forbidden|

## 必要的要求標頭

\| 標頭| 類型| 描述|
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| Authorization| string| HTTP 驗證的驗證認證。範例值："XBL3.0 x=\<userhash>;\<token>"。|

## 選用的要求標頭

\| 標頭| 類型| 描述|
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| **X-RequestedServiceVersion**| string| 此要求應導向之 XBOX LIVE 服務的組建名稱/編號。只有在驗證標頭的有效性、驗證權杖中的宣告等之後，要求才會路由至該服務。預設值：1。|
\| **x-xbl-contract-version**| 32 位元不帶正負號整數| 如果存在且設定為 2，將使用此 API 的 V2 版本。否則使用 V1。|
\| **Accept-Language**| string| 所需地區設定及後援的清單 (例如 fr-FR、fr、en-GB、en-WW、en-US)。成就服務會依序檢查清單，直到找到相符的當地語系化字串為止。如果找不到，則會嘗試比對使用者權杖中定義的位置，該位置來自使用者的 IP 位址。如果仍然找不到相符的當地語系化字串，則會使用遊戲開發人員/發行者提供的預設字串。 |

## 要求本文

此要求的本文中不會傳送任何物件。

## 回應本文

如果呼叫成功，服務會傳回 [Achievement (JSON)](https://docs.xbox.com/zh-TW/reference/live/rest/json/json-achievementv2.md) 物件陣列和 [PagingInfo (JSON)](https://docs.xbox.com/zh-TW/reference/live/rest/json/json-paginginfo.md) 物件。

### 範例回應

```cpp theme={null}
{
    "achievements":
    [{
        "id":"3",
        "serviceConfigId":"b5dd9daf-0000-0000-0000-000000000000",
        "name":"Default NameString for Microsoft Achievements Sample Achievement 3",
        "titleAssociations":
        [{
                "name":"Microsoft Achievements Sample",
                "id":3051199919,
                "version":"abc"
        }],
        "progressState":"Achieved",
        "progression":
        {
                "achievementState":"Achieved",
                "requirements":null,
                "timeUnlocked":"2013-01-17T03:19:00.3087016Z",
        },
        "mediaAssets":
        [{
                "name":"Icon Name",
                "type":"Icon",
                "url":"http://www.xbox.com"
        }],
        "platform":"D",
        "isSecret":true,
        "description":"Default DescriptionString for Microsoft Achievements Sample Achievement 3",
        "lockedDescription":"Default UnachievedString for Microsoft Achievements Sample Achievement 3",
        "productId":"12345678-1234-1234-1234-123456789012",
        "achievementType":"Challenge",
        "participationType":"Individual",
        "timeWindow":
        {
                "startDate":"2013-02-01T00:00:00Z",
                "endDate":"2100-07-01T00:00:00Z"
        },
        "rewards":
        [{
                "name":null,
                "description":null,
                "value":"10",
                "type":"Gamerscore",
                "valueType":"Int"
        },
        {
                "name":"Default Name for InAppReward for Microsoft Achievements Sample Achievement 3",
                "description":"Default Description for InAppReward for Microsoft Achievements Sample Achievement 3",
                "value":"1",
                "type":"InApp",
                "valueType":"String"
        }],
        "estimatedTime":"06:12:14",
        "deeplink":"aWFtYWRlZXBsaW5r",
        "isRevoked":false
        }],
        "pagingInfo":
        {
                "continuationToken":null,
                "totalRecords":1
        }
}
         
```

## 另請參閱

##### 上層

[/users/xuid({xuid})/achievements](https://docs.xbox.com/zh-TW/reference/live/rest/uri/achievements/uri-achievementsusersxuidachievementsv2.md)

##### 參考

[Achievement (JSON)](https://docs.xbox.com/zh-TW/reference/live/rest/json/json-achievementv2.md)

[PagingInfo (JSON)](https://docs.xbox.com/zh-TW/reference/live/rest/json/json-paginginfo.md)

[分頁參數](https://docs.xbox.com/zh-TW/reference/live/rest/additional/pagingparameters.md)


## Related topics

- [GET (/users/xuid({xuid})/achievements/{scid}/{achievementid})](https://docs.xbox.com/zh-TW/reference/live/rest/uri/achievements/uri-usersxuidachievementsscidachievementidget.md)
- [/users/xuid({xuid})/achievements](https://docs.xbox.com/zh-TW/reference/live/rest/uri/achievements/uri-achievementsusersxuidachievementsv2.md)
- [/users/xuid({xuid})/achievements/{scid}/{achievementid}](https://docs.xbox.com/zh-TW/reference/live/rest/uri/achievements/uri-usersxuidachievementsscidachievementid.md)
- [/users/xuid({xuid})/achievements/{scid}/update](https://docs.xbox.com/zh-TW/reference/live/rest/uri/achievements/uri-usersxuidachievementsscidupdate.md)
- [GET (/users/xuid({xuid})/history/titles)](https://docs.xbox.com/zh-TW/reference/live/rest/uri/titlehistory/uri-titlehistoryusersxuidhistorytitlesgetv2.md)
