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

# PresenceRecord (JSON)

> PresenceRecord (JSON)

# PresenceRecord (JSON)

关于单个用户在线状态的数据。

## PresenceRecord

PresenceRecord 对象具有以下规范。

| 成员 | 类型 | 说明 |
| - | - | - |
| xuid | string | 目标用户的 XBOX User ID (XUID)。所提供的在线状态数据属于此用户。 |
| devices | [DeviceRecord](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-devicerecord) 数组 | 用户设备记录的列表。 |
| state | string | 用户在 XBOX LIVE 上的活动。可能的值:<ul><li>Online:用户至少拥有一条设备记录。</li><li>Away:用户已登录 XBOX LIVE,但未在任何标题中活动。</li><li>Offline:用户不在任何设备上。</li></ul> |
| lastSeen | [LastSeenRecord](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-lastseenrecord) | 只有当用户没有有效的 DeviceRecord 时,才会提供最后一次上线信息。如果该对象已从缓存中移除,由于没有持久化存储,可能不会返回其数据。 |

## JSON 语法示例

```json theme={null}
{
  xuid:"0123456789",
  state:"online",
  devices:
  [{
    type:"D",
    titles:
    [{
      id:"12341234",
      name:"Contoso 5",
      state:"active",
      placement:"fill",
      timestamp:"2012-09-17T07:15:23.4930000",
      activity:
      {
        richPresence:"Team Deathmatch on Nirvana"
      }
    },
    {
      id:"12341235",
      name:"Contoso Waypoint",
      timestamp:"2012-09-17T07:15:23.4930000",
      placement:"snapped",
      state:"active",
      activity:
      {
        richPresence:"Using radar"
      }
    }]
  },
  {
    type:"W8",
    titles:
    [{
      id:"23452345",
      name:"Contoso Gamehelp",
      state:"active",
      placement:"full",
      timestamp:"2012-09-17T07:15:23.4930000",
      activity:
      {
        richPresence:"Nirvana page"
      }
    }]
  }]
}

```

## 另请参阅

##### 父主题

[JavaScript 对象表示法 (JSON) 对象参考](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/atoc-xboxlivews-reference-json)

##### 参考

[POST (/users/batch)](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/presence/uri-usersbatchpost)

[GET (/users/me)](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/presence/uri-usersmeget)

[DELETE (/users/xuid({xuid})/devices/current/titles/current)](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/presence/uri-usersxuiddevicescurrenttitlescurrentdelete)

[GET (/users/xuid({xuid}))](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/presence/uri-usersxuidget)


## Related topics

- [XblSocialManagerPresenceRecordIsUserPlayingTitle](https://devdocs.xbox.com/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerpresencerecordisuserplayingtitle.md)
- [Updating a user's Presence via REST](https://devdocs.xbox.com/services/xbox-services/community/presence/how-to/live-updating-presence-rest.md)
