Team room users

Last Update: 12/5/2016

api-version = 1.0

If you haven't already, look at the information on getting started with these APIs.

Get a list of users

GET https://{instance}/DefaultCollection/_apis/chat/rooms/{roomId}/users?api-version={version}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
roomId int ID of the team room.
Query
api-version string Version of the API to use.

Sample request

GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/chat/rooms/305/users?api-version=1.0

Sample response

Status code: 200
{
  "count": 6,
  "value": [
    {
      "roomId": 305,
      "user": {
        "id": "d6245f20-2af8-44f4-9451-8107cb2767db",
        "displayName": "Normal Paulk",
        "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
        "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
      },
      "lastActivity": "2014-10-27T16:36:02.28Z",
      "joinedDate": "2014-10-27T16:36:02.203Z",
      "isOnline": true
    },
    {
      "roomId": 305,
      "user": {
        "id": "3b5f0c34-4aec-4bf4-8708-1d36f0dbc468",
        "displayName": "Christie Church",
        "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/3b5f0c34-4aec-4bf4-8708-1d36f0dbc468",
        "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=3b5f0c34-4aec-4bf4-8708-1d36f0dbc468"
      },
      "lastActivity": "0001-01-01T00:00:00",
      "joinedDate": "0001-01-01T00:00:00",
      "isOnline": false
    },
    {
      "roomId": 305,
      "user": {
        "id": "8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
        "displayName": "Chuck Reinhart",
        "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
        "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d"
      },
      "lastActivity": "0001-01-01T00:00:00",
      "joinedDate": "0001-01-01T00:00:00",
      "isOnline": false
    },
    {
      "roomId": 305,
      "user": {
        "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
        "displayName": "Fabrikam Fiber",
        "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
        "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
      },
      "lastActivity": "0001-01-01T00:00:00",
      "joinedDate": "0001-01-01T00:00:00",
      "isOnline": false
    },
    {
      "roomId": 305,
      "user": {
        "id": "19d9411e-9a34-45bb-b985-d24d9d87c0c9",
        "displayName": "Johnnie McLeod",
        "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/19d9411e-9a34-45bb-b985-d24d9d87c0c9",
        "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=19d9411e-9a34-45bb-b985-d24d9d87c0c9"
      },
      "lastActivity": "0001-01-01T00:00:00",
      "joinedDate": "0001-01-01T00:00:00",
      "isOnline": false
    },
    {
      "roomId": 305,
      "user": {
        "id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
        "displayName": "Jamal Hartnett",
        "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
        "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff"
      },
      "lastActivity": "0001-01-01T00:00:00",
      "joinedDate": "0001-01-01T00:00:00",
      "isOnline": false
    }
  ]
}

Get a user

GET https://{instance}/DefaultCollection/_apis/chat/rooms/{roomId}/users/{userId}?api-version={version}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
roomId int ID of the team room.
userId int ID of the user.
Query
api-version string Version of the API to use.

Sample request

GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/chat/rooms/305/users/d6245f20-2af8-44f4-9451-8107cb2767db?api-version=1.0

Sample response

Status code: 200
{
  "roomId": 305,
  "user": {
    "id": "d6245f20-2af8-44f4-9451-8107cb2767db",
    "displayName": "Normal Paulk",
    "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
    "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
  },
  "lastActivity": "2014-10-27T16:36:02.28Z",
  "joinedDate": "2014-10-27T16:36:02.203Z",
  "isOnline": true
}

Join a room

PUT https://{instance}/DefaultCollection/_apis/chat/rooms/{roomId}/users/{userId}?api-version={version}
Content-Type: application/json
{
    userId: {int}
}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
roomId int ID of the team room.
userId int ID of the authenticated user.
Query
api-version string Version of the API to use.

Sample request

PUT https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/chat/rooms/305/users/d6245f20-2af8-44f4-9451-8107cb2767db?api-version=1.0
Content-Type: application/json
{
  "userId": "d6245f20-2af8-44f4-9451-8107cb2767db"
}

Sample response

Status code: 204

Leave a room

DELETE https://{instance}/DefaultCollection/_apis/chat/rooms/{roomId}/users/{userId}?api-version={version}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
roomId int ID of the team room.
userId int ID of the authenticated user.
Query
api-version string Version of the API to use.

Sample request

DELETE https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/chat/rooms/305/users/d6245f20-2af8-44f4-9451-8107cb2767db?api-version=1.0

Sample response

Status code: 204