Platform API

<back to all web services

GetAttachments

Requires Authentication
The following routes are available for this service:
All Verbs/api/attachments/{ConnectedObjectId}
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 MediaModel
    {
        public virtual Guid MediaFileId { get; set; }
        public virtual string MediaName { get; set; }
        public virtual string FileContent { get; set; }
        public virtual string FileContentType { get; set; }
        public virtual string FilePath { get; set; }
        public virtual string OriginalFileName { get; set; }
        public virtual int ImageWidth { get; set; }
        public virtual int ImageHeight { get; set; }
        public virtual int FileSizeKB { get; set; }
        public virtual string BlobUriRaw { get; set; }
        public virtual string BlobUriFull { get; set; }
        public virtual string BlobUriThumbnail { get; set; }
        public virtual string WatermarkUri { get; set; }
        public virtual DateTime CapturedDate { get; set; }
        public virtual Guid? CapturedByContactId { get; set; }
        public virtual string CapturedByContactName { get; set; }
        public virtual string CapturedByContactThumbnailUrl { get; set; }
        public virtual string Notes { get; set; }
        public virtual string ResourceActionName { get; set; }
        public virtual string LocationVerified { get; set; }
        public virtual Guid TrafficLightLocationVerified { get; set; }
        public virtual string AudienceLevel { get; set; }
        public virtual string WorksFor { get; set; }
    }

}

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 virtual Guid ConnectedObjectId { get; set; }
    }

    [ApiResponse(Description="Returns list of attachments linked to an object.")]
    public partial class GetAttachmentsResponse
    {
        public virtual List<MediaModel> Attachments { get; set; }
        public virtual ResponseStatus ResponseStatus { get; set; }
    }

}

C# GetAttachments DTOs

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

HTTP + CSV

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: text/csv
Content-Type: text/csv
Content-Length: length

{"ConnectedObjectId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: text/csv
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"}}}