Platform API

<back to all web services

GetRelatedItems

Get related items related to the specified object.

Requires Authentication
The following routes are available for this service:
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

VB.NET GetRelatedItems DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

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: text/jsonl
Content-Type: text/jsonl
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: text/jsonl
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"}}}