| All Verbs | /api/relateditems/{ObjectId} |
|---|
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Eros.Subtle.Canvara.WebAPIModel.ServiceModel
Imports Eros.Saguna.Common.WebAPIModel.Models
Namespace Global
Namespace Eros.Saguna.Common.WebAPIModel.Models
Public Partial Class PagedModel
'''<Summary>
'''Page Number to retrieve
'''</Summary>
<ApiMember(DataType:="int", Description:="Page Number to retrieve", Name:="PageNumber")>
Public Overridable Property PageNumber As Integer
'''<Summary>
'''Number of records to retrieve
'''</Summary>
<ApiMember(DataType:="int", Description:="Number of records to retrieve", Name:="PageSize")>
Public Overridable Property PageSize As Integer
'''<Summary>
'''Index of field to sort results by
'''</Summary>
<ApiMember(DataType:="int", Description:="Index of field to sort results by", Name:="SortIndex")>
Public Overridable Property SortIndex As Integer
'''<Summary>
'''Sort Order - Ascending or Descending
'''</Summary>
<ApiMember(DataType:="int", Description:="Sort Order - Ascending or Descending", Name:="SortOrder")>
Public Overridable Property SortOrder As SortOrder
End Class
Public Partial Class RelatedItemsModel
'''<Summary>
'''Object linked to the related item.
'''</Summary>
<ApiMember(DataType:="Guid", Description:="Object linked to the related item.", IsRequired:=true, Name:="ObjectId")>
Public Overridable Property ObjectId As Guid
'''<Summary>
'''Related item name.
'''</Summary>
<ApiMember(DataType:="string", Description:="Related item name.", Name:="RelatedItemName")>
Public Overridable Property RelatedItemName As String
'''<Summary>
'''Related item type.
'''</Summary>
<ApiMember(DataType:="string", Description:="Related item type.", Name:="RelatedItemType")>
Public Overridable Property RelatedItemType As String
'''<Summary>
'''Date of creation of the related item.
'''</Summary>
<ApiMember(DataType:="DateTime", Description:="Date of creation of the related item.", IsRequired:=true, Name:="CreatedAt")>
Public Overridable Property CreatedAt As Date
'''<Summary>
'''Contact who created the related item
'''</Summary>
<ApiMember(DataType:="string", Description:="Contact who created the related item", Name:="CreatedByName")>
Public Overridable Property CreatedByName As String
'''<Summary>
'''Contact who created the related item
'''</Summary>
<ApiMember(DataType:="Guid", Description:="Contact who created the related item", Name:="CreatedById")>
Public Overridable Property CreatedById As Guid
'''<Summary>
'''Profile photo of the contact who created the related item
'''</Summary>
<ApiMember(DataType:="string", Description:="Profile photo of the contact who created the related item", Name:="CreatedByThumbnailUrl")>
Public Overridable Property CreatedByThumbnailUrl As String
'''<Summary>
'''Relationship between objects linked to the related item
'''</Summary>
<ApiMember(DataType:="string", Description:="Relationship between objects linked to the related item", Name:="Relationship")>
Public Overridable Property Relationship As String
'''<Summary>
'''Is the related item significant?
'''</Summary>
<ApiMember(DataType:="bool", Description:="Is the related item significant?", IsRequired:=true, Name:="IsSignificant")>
Public Overridable Property IsSignificant As Boolean
End Class
Public Enum SortOrder
Ascending
Descending
End Enum
End Namespace
Namespace Eros.Subtle.Canvara.WebAPIModel.ServiceModel
'''<Summary>
'''Get related items related to the specified object.
'''</Summary>
<Api(Description:="Get related items related to the specified object.")>
Public Partial Class GetRelatedItems
Inherits PagedModel
'''<Summary>
'''Object to get related items for.
'''</Summary>
<ApiMember(Description:="Object to get related items for.", IsRequired:=true, Name:="ObjectId")>
Public Overridable Property ObjectId As Guid
'''<Summary>
'''Significant Only or All
'''</Summary>
<ApiMember(Description:="Significant Only or All", IsRequired:=true, Name:="RelatedItemsLevel")>
Public Overridable Property RelatedItemsLevel As Guid
'''<Summary>
'''Return all connections or paged results?
'''</Summary>
<ApiMember(Description:="Return all connections or paged results?", Name:="IsPagedMode")>
Public Overridable Property IsPagedMode As Boolean
End Class
<ApiResponse(Description:="Items related to the object.")>
Public Partial Class GetRelatedItemsResponse
Public Overridable Property RelatedItems As List(Of RelatedItemsModel)
Public Overridable Property TotalRelatedItems As Integer
Public Overridable Property ResponseStatus As ResponseStatus
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/relateditems/{ObjectId} HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/json
Content-Type: application/json
Content-Length: length
{"ObjectId":"00000000-0000-0000-0000-000000000000","RelatedItemsLevel":"00000000-0000-0000-0000-000000000000","IsPagedMode":false,"PageNumber":0,"PageSize":0,"SortIndex":0,"SortOrder":"Ascending"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"RelatedItems":[{"ObjectId":"00000000-0000-0000-0000-000000000000","RelatedItemName":"String","RelatedItemType":"String","CreatedAt":"0001-01-01T00:00:00.0000000","CreatedByName":"String","CreatedById":"00000000-0000-0000-0000-000000000000","CreatedByThumbnailUrl":"String","Relationship":"String","IsSignificant":false}],"TotalRelatedItems":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}