Platform API

<back to all web services

GetAttachments

Requires Authentication
The following routes are available for this service:
All Verbs/api/attachments/{ConnectedObjectId}
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Eros.Saguna.Common.WebAPIModel.ServiceModels
Imports Eros.Saguna.Common.WebAPIModel.Models

Namespace Global

    Namespace Eros.Saguna.Common.WebAPIModel.Models

        Public Partial Class MediaModel
            Public Overridable Property MediaFileId As Guid
            Public Overridable Property MediaName As String
            Public Overridable Property FileContent As String
            Public Overridable Property FileContentType As String
            Public Overridable Property FilePath As String
            Public Overridable Property OriginalFileName As String
            Public Overridable Property ImageWidth As Integer
            Public Overridable Property ImageHeight As Integer
            Public Overridable Property FileSizeKB As Integer
            Public Overridable Property BlobUriRaw As String
            Public Overridable Property BlobUriFull As String
            Public Overridable Property BlobUriThumbnail As String
            Public Overridable Property WatermarkUri As String
            Public Overridable Property CapturedDate As Date
            Public Overridable Property CapturedByContactId As Guid?
            Public Overridable Property CapturedByContactName As String
            Public Overridable Property CapturedByContactThumbnailUrl As String
            Public Overridable Property Notes As String
            Public Overridable Property ResourceActionName As String
            Public Overridable Property LocationVerified As String
            Public Overridable Property TrafficLightLocationVerified As Guid
            Public Overridable Property AudienceLevel As String
            Public Overridable Property WorksFor As String
        End Class
    End Namespace

    Namespace Eros.Saguna.Common.WebAPIModel.ServiceModels

        Public Partial Class GetAttachments
            '''<Summary>
            '''Object for which primary image is to be uploaded.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Object for which primary image is to be uploaded.", IsRequired:=true, Name:="ConnectedObjectId")>
            Public Overridable Property ConnectedObjectId As Guid
        End Class

        <ApiResponse(Description:="Returns list of attachments linked to an object.")>
        Public Partial Class GetAttachmentsResponse
            Public Overridable Property Attachments As List(Of MediaModel)
            Public Overridable Property ResponseStatus As ResponseStatus
        End Class
    End Namespace
End Namespace

VB.NET GetAttachments DTOs

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

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/attachments/{ConnectedObjectId} HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"ConnectedObjectId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Attachments":[{"MediaFileId":"00000000-0000-0000-0000-000000000000","MediaName":"String","FileContent":"String","FileContentType":"String","FilePath":"String","OriginalFileName":"String","ImageWidth":0,"ImageHeight":0,"FileSizeKB":0,"BlobUriRaw":"String","BlobUriFull":"String","BlobUriThumbnail":"String","WatermarkUri":"String","CapturedDate":"0001-01-01T00:00:00.0000000","CapturedByContactId":"00000000000000000000000000000000","CapturedByContactName":"String","CapturedByContactThumbnailUrl":"String","Notes":"String","ResourceActionName":"String","LocationVerified":"String","TrafficLightLocationVerified":"00000000-0000-0000-0000-000000000000","AudienceLevel":"String","WorksFor":"String"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}