diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj
index 0dfd812c3..e79163d80 100644
--- a/MediaBrowser.Api/MediaBrowser.Api.csproj
+++ b/MediaBrowser.Api/MediaBrowser.Api.csproj
@@ -106,6 +106,7 @@
+
diff --git a/MediaBrowser.Api/Social/SharingService.cs b/MediaBrowser.Api/Social/SharingService.cs
new file mode 100644
index 000000000..93540f8ca
--- /dev/null
+++ b/MediaBrowser.Api/Social/SharingService.cs
@@ -0,0 +1,138 @@
+using MediaBrowser.Common.Extensions;
+using MediaBrowser.Controller.Dlna;
+using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Net;
+using MediaBrowser.Controller.Social;
+using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Social;
+using ServiceStack;
+using System;
+using System.IO;
+using System.Threading.Tasks;
+
+namespace MediaBrowser.Api.Social
+{
+ [Route("/Social/Shares/{Id}", "GET", Summary = "Gets a share")]
+ [Authenticated]
+ public class GetSocialShareInfo : IReturn
+ {
+ [ApiMember(Name = "Id", Description = "The id of the item", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
+ public string Id { get; set; }
+ }
+
+ [Route("/Social/Shares/Public/{Id}", "GET", Summary = "Gets a share")]
+ public class GetPublicSocialShareInfo : IReturn
+ {
+ [ApiMember(Name = "Id", Description = "The id of the item", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
+ public string Id { get; set; }
+ }
+
+ [Route("/Social/Shares/Public/{Id}/Image", "GET", Summary = "Gets a share")]
+ public class GetShareImage
+ {
+ [ApiMember(Name = "Id", Description = "The id of the item", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
+ public string Id { get; set; }
+ }
+
+ [Route("/Social/Shares", "POST", Summary = "Creates a share")]
+ [Authenticated]
+ public class CreateShare : IReturn
+ {
+ [ApiMember(Name = "ItemId", Description = "The id of the item", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
+ public string ItemId { get; set; }
+
+ [ApiMember(Name = "UserId", Description = "The user id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
+ public string UserId { get; set; }
+ }
+
+ [Route("/Social/Shares/{Id}", "DELETE", Summary = "Deletes a share")]
+ [Authenticated]
+ public class DeleteShare : IReturnVoid
+ {
+ [ApiMember(Name = "Id", Description = "The id of the item", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")]
+ public string Id { get; set; }
+ }
+
+ public class SharingService : BaseApiService
+ {
+ private readonly ISharingManager _sharingManager;
+ private readonly ILibraryManager _libraryManager;
+ private readonly IDlnaManager _dlnaManager;
+
+ public SharingService(ISharingManager sharingManager, IDlnaManager dlnaManager, ILibraryManager libraryManager)
+ {
+ _sharingManager = sharingManager;
+ _dlnaManager = dlnaManager;
+ _libraryManager = libraryManager;
+ }
+
+ public object Get(GetSocialShareInfo request)
+ {
+ var info = _sharingManager.GetShareInfo(request.Id);
+
+ return ToOptimizedResult(info);
+ }
+
+ public object Get(GetPublicSocialShareInfo request)
+ {
+ var info = _sharingManager.GetShareInfo(request.Id);
+
+ if (info.ExpirationDate >= DateTime.UtcNow)
+ {
+ throw new ResourceNotFoundException();
+ }
+
+ return ToOptimizedResult(info);
+ }
+
+ public async Task