createShare

Creates a public URL that can be used by anyone to stream music or video from the server.

http://your-server/rest/createShare Since 1.6.0

Creates a public URL that can be used by anyone to stream music or video from the server. The URL is short and suitable for posting on Facebook, Twitter etc. Note: The user must be authorized to share (see Settings > Users > User is allowed to share files with anyone).

Parameters

Parameter Req. OpenS. Default Comment
id Yes ID of a song, album or video to share. Use one id parameter for each entry to share.
description No A user-defined description that will be displayed to people visiting the shared media.
expires No The time at which the share expires. Given as milliseconds since 1970.

Example

Result

A subsonic-response element with a nested shares element on success. Which in turns contains a single share element for the newly created share

{
  "subsonic-response": {
    "status": "ok",
    "version": "1.16.1",
    "type": "AwesomeServerName",
    "serverVersion": "0.1.3 (tag)",
    "openSubsonic": true
    "shares": {
      "share": [
        {
          "id": "12",
          "url": "http://localhost:8989/share.php?id=12&secret=fXlKyEv3",
          "description": "Forget and Remember (Comfort Fit)",
          "username": "user",
          "created": "2023-03-16T04:13:09+00:00",
          "visitCount": 0,
          "entry": [
            {
              "id": "300000116",
              "parent": "200000021",
              "title": "Can I Help U?",
              "isDir": false,
              "isVideo": false,
              "type": "music",
              "albumId": "200000021",
              "album": "Forget and Remember",
              "artistId": "100000036",
              "artist": "Comfort Fit",
              "coverArt": "300000116",
              "duration": 103,
              "bitRate": 216,
              "bitDepth": 16,
              "samplingRate": 44100,
              "channelCount": 2,
              "track": 1,
              "year": 2005,
              "genre": "Hip-Hop",
              "size": 2811819,
              "discNumber": 1,
              "suffix": "mp3",
              "contentType": "audio/mpeg",
              "path": "user/Comfort Fit/Forget And Remember/1 - Can I Help U?.mp3"
            },
            {
              "id": "300000121",
              "parent": "200000021",
              "title": "Planetary Picknick",
              "isDir": false,
              "isVideo": false,
              "type": "music",
              "albumId": "200000021",
              "album": "Forget and Remember",
              "artistId": "100000036",
              "artist": "Comfort Fit",
              "coverArt": "300000121",
              "duration": 358,
              "bitRate": 238,
              "bitDepth": 16,
              "samplingRate": 44100,
              "channelCount": 2,
              "track": 2,
              "year": 2005,
              "genre": "Hip-Hop",
              "size": 10715592,
              "discNumber": 1,
              "suffix": "mp3",
              "contentType": "audio/mpeg",
              "path": "user/Comfort Fit/Forget And Remember/2 - Planetary Picknick.mp3"
            }
          ]
        }
      ]
    }
  }
}
{
  "subsonic-response": {
    "status": "ok",
    "version": "1.16.1",
    "shares": {
      "share": [
        {
          "id": "12",
          "url": "http://localhost:8989/share.php?id=12&secret=fXlKyEv3",
          "description": "Forget and Remember (Comfort Fit)",
          "username": "user",
          "created": "2023-03-16T04:13:09+00:00",
          "visitCount": 0,
          "entry": [
            {
              "id": "300000116",
              "parent": "200000021",
              "title": "Can I Help U?",
              "isDir": false,
              "isVideo": false,
              "type": "music",
              "albumId": "200000021",
              "album": "Forget and Remember",
              "artistId": "100000036",
              "artist": "Comfort Fit",
              "coverArt": "300000116",
              "duration": 103,
              "bitRate": 216,
              "bitDepth": 16,
              "samplingRate": 44100,
              "channelCount": 2,
              "track": 1,
              "year": 2005,
              "genre": "Hip-Hop",
              "size": 2811819,
              "discNumber": 1,
              "suffix": "mp3",
              "contentType": "audio/mpeg",
              "path": "user/Comfort Fit/Forget And Remember/1 - Can I Help U?.mp3"
            },
            {
              "id": "300000121",
              "parent": "200000021",
              "title": "Planetary Picknick",
              "isDir": false,
              "isVideo": false,
              "type": "music",
              "albumId": "200000021",
              "album": "Forget and Remember",
              "artistId": "100000036",
              "artist": "Comfort Fit",
              "coverArt": "300000121",
              "duration": 358,
              "bitRate": 238,
              "bitDepth": 16,
              "samplingRate": 44100,
              "channelCount": 2,
              "track": 2,
              "year": 2005,
              "genre": "Hip-Hop",
              "size": 10715592,
              "discNumber": 1,
              "suffix": "mp3",
              "contentType": "audio/mpeg",
              "path": "user/Comfort Fit/Forget And Remember/2 - Planetary Picknick.mp3"
            }
          ]
        }
      ]
    }
  }
}
Field Type Req. OpenS. Details
shares shares Yes The created share