| POST | /api/attachments |
|---|
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 AddAttachments
{
///<summary>
/// including file content, file type, content type and connected object.
///</summary>
[ApiMember(DataType="string", Description=" including file content, file type, content type and connected object.", Name="Files", ParameterType="query")]
public virtual List<MediaModel> Files { get; set; }
///<summary>
///Appliance from which primary image file is to be uploaded.
///</summary>
[ApiMember(DataType="Guid", Description="Appliance from which primary image file is to be uploaded.", IsRequired=true, Name="ApplianceId")]
public virtual Guid ApplianceId { get; set; }
///<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; }
///<summary>
///Licensee Id of the Object owner for which primary image is to be uploaded.
///</summary>
[ApiMember(DataType="Guid", Description="Licensee Id of the Object owner for which primary image is to be uploaded.", IsRequired=true, Name="ConnectedObjectLicenseeId")]
public virtual Guid ConnectedObjectLicenseeId { get; set; }
}
public partial class AddAttachmentsResponse
{
public virtual ResponseStatus ResponseStatus { get; set; }
}
}
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/attachments HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Files":[{"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"}],"ApplianceId":"00000000-0000-0000-0000-000000000000","ConnectedObjectId":"00000000-0000-0000-0000-000000000000","ConnectedObjectLicenseeId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}