| GET | /api/object/{ObjectId}/reads |
|---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Eros.Saguna.Common.WebAPIModel.ServiceModels;
using Eros.Saguna.Common.WebAPIModel.Models;
namespace Eros.Saguna.Common.WebAPIModel.Models
{
public partial class ObjectAccessModel
{
///<summary>
///Object Access Read Id.
///</summary>
[ApiMember(Description="Object Access Read Id.", Name="ObjectReadId")]
public virtual Guid ObjectReadId { get; set; }
///<summary>
///Object Id viewing the specified Object.
///</summary>
[ApiMember(Description="Object Id viewing the specified Object.", IsRequired=true, Name="ViewingObjectId")]
public virtual Guid ViewingObjectId { get; set; }
///<summary>
///Name of the object viewing the specified Object.
///</summary>
[ApiMember(Description="Name of the object viewing the specified Object.", Name="ViewingObjectName")]
public virtual string ViewingObjectName { get; set; }
///<summary>
///Name of the object viewing the specified Object.
///</summary>
[ApiMember(Description="Name of the object viewing the specified Object.", Name="ViewingObjectPrimaryImageUrl")]
public virtual string ViewingObjectPrimaryImageUrl { get; set; }
///<summary>
///Id of the object being viewed.
///</summary>
[ApiMember(Description="Id of the object being viewed.", IsRequired=true, Name="ViewedObjectId")]
public virtual Guid ViewedObjectId { get; set; }
///<summary>
///Name of the object being viewed.
///</summary>
[ApiMember(Description="Name of the object being viewed.", Name="ViewedObjectName")]
public virtual string ViewedObjectName { get; set; }
///<summary>
///Date and Time of object read
///</summary>
[ApiMember(Description="Date and Time of object read", Name="TimeRead")]
public virtual DateTime? TimeRead { get; set; }
///<summary>
///Date and Time object started watching the specified object.
///</summary>
[ApiMember(Description="Date and Time object started watching the specified object.", Name="TimeStartWatching")]
public virtual DateTime? TimeStartWatching { get; set; }
///<summary>
///Date and Time of object being flagged.
///</summary>
[ApiMember(Description="Date and Time of object being flagged.", Name="Flagged")]
public virtual DateTime Flagged { get; set; }
}
}
namespace Eros.Saguna.Common.WebAPIModel.ServiceModels
{
///<summary>
///Get reads (object access) for the specified object.
///</summary>
[Api(Description="Get reads (object access) for the specified object.")]
public partial class GetObjectReads
{
///<summary>
///Object Id to get object access reads for
///</summary>
[ApiMember(DataType="Guid", Description="Object Id to get object access reads for", IsRequired=true, Name="ObjectId")]
public virtual Guid ObjectId { get; set; }
}
[ApiResponse(Description="Returns the reads (object access) to the specified object.")]
public partial class GetObjectReadsResponse
{
public virtual List<ObjectAccessModel> ObjectReads { get; set; }
public virtual ResponseStatus ResponseStatus { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/object/{ObjectId}/reads HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ObjectReads:
[
{
ViewingObjectName: String,
ViewingObjectPrimaryImageUrl: String,
ViewedObjectName: String,
TimeRead: 0001-01-01,
TimeStartWatching: 0001-01-01,
Flagged: 0001-01-01
}
],
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}