Get websocket endpoint

Namespace: microsoft.graph

Allows you to receive near-real-time change notifications for a drive and list using is a popular notifications library for JavaScript that utilizes WebSockets. To learn more, see


One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Files.Read, Files.ReadWrite, Files.ReadWrite.All, Sites.ReadWrite.All
Delegated (personal Microsoft account) Files.Read, Files.ReadWrite, Files.ReadWrite.All
Application Not supported.

HTTP request

GET /me/drive/root/subscriptions/socketIo
GET /drives/{driveId}/root/subscriptions/socketIo
GET /drives/{driveId}/list/subscriptions/socketIo
GET /groups/{groupId}/drive/root/subscriptions/socketIo
GET /sites/{siteId}/lists/{listId}/drive/root/subscriptions/socketIo



GET /me/drive/root/subscriptions/socketIo


If successful, this method returns a 200 OK response code and a subscription object in the response body.

HTTP/1.1 200 OK
Content-type: application/json

  "id": "opaqueId-fj3hd7yf283jfk193726nvc2w3i2diemdu8",
  "notificationUrl": ""

The notificationUrl returned is a endpoint URL.

The following example shows how to use the notificationUrl with in JavaScript.

// this is the notificationUrl returned from this API
var notificationUrl = "";

// 'io' comes from the client library
var socket = io(notificationUrl);

// these examples log to the console.
// your app would provide its own callbacks
socket.on("connect", ()=>console.log("Connected!"));
socket.on("notification", (data)=>console.log("Notification!", data));