Skip to content

Instantly share code, notes, and snippets.

@Techbrunch
Created April 27, 2020 17:45
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Techbrunch/dc299b746969ae9a0cb52b21f5b174b6 to your computer and use it in GitHub Desktop.
Save Techbrunch/dc299b746969ae9a0cb52b21f5b174b6 to your computer and use it in GitHub Desktop.
Microsoft Team Presence

Presence is part of a user's profile in Microsoft Teams (and throughout Office 365) that indicates the user's current availability and status to other users. By default, anyone in your organization using Teams can see (in nearly real time) if other users are available online.

Teams presence in Outlook is supported on the Outlook 2013 desktop app and later.

Source: https://docs.microsoft.com/en-us/microsoftteams/presence-admins

Request:

GET /api/mt/emea/beta/users/first.last@example.com/externalsearch HTTP/1.1
Host: teams.microsoft.com
Connection: close
Authorization: Bearer eyJ...

Response:

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Content-Type: application/json; charset=utf-8
X-ServerRequestId: 211526CE19A34F4397239F8DE2AA3558
X-MachineName: mtsvc00001H
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-MSEdge-Ref: Ref A: 211526CE19A34F4397239F8DE2AA3558 Ref B: PRAEDGE1020 Ref C: 2020-04-27T17:26:24Z
Date: Mon, 27 Apr 2020 17:26:24 GMT
Connection: close
Content-Length: 425

{
    "displayName": "first.last@example.com",
    "email": "first.last@example.com",
    "featureSettings": {
        "coExistenceMode": "TeamsOnly"
    },
    "givenName": "first.last@example.com",
    "isShortProfile": false,
    "mri": "8:orgid:f3fb18c3-0ece-464e-8474-a9670ce5fda5",
    "objectId": "f3fb18c3-0ece-464e-8474-a9670ce5fda5",
    "surname": "",
    "tenantId": "43b73b11-10b4-40c6-9169-7b660c2623d1",
    "type": "Federated",
    "userPrincipalName": "first.last@example.com"
}

Request:

POST /v1/presence/getpresence/ HTTP/1.1
Host: presence.teams.microsoft.com
Connection: close
Content-Length: 56
Authorization: Bearer eyJ...
Content-Type: application/json

[{"mri":"8:orgid:f3fb18c3-0ece-464e-8474-a9670ce5fda5"}]

Response:

HTTP/1.1 200 OK
Content-Length: 248
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
x-ms-correlation-id: 36beaad0-785e-4ab2-b0fc-83af8a36bcb0
Access-Control-Expose-Headers: Location,Content-Length,x-ms-correlation-id
Date: Mon, 27 Apr 2020 17:18:30 GMT
Connection: close

[
    {
        "etag": "h+mJImQ/cyswasvt90qgWrksCWuZWF0n2eG8wjDQ0j0=",
        "etagMatch": false,
        "mri": "8:orgid:f3fb18c3-0ece-464e-8474-a9670ce5fda5",
        "presence": {
          "activity": "Busy",
          "availability": "Busy",
          "capabilities": [],
          "deviceType": "Desktop",
          "sourceNetwork": "Federated"
        },
        "status": 20000
    }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment