| All Verbs | /api/attachments/{ConnectedObjectId} |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MediaModel:
media_file_id: Optional[str] = None
media_name: Optional[str] = None
file_content: Optional[str] = None
file_content_type: Optional[str] = None
file_path: Optional[str] = None
original_file_name: Optional[str] = None
image_width: int = 0
image_height: int = 0
file_size_k_b: int = 0
blob_uri_raw: Optional[str] = None
blob_uri_full: Optional[str] = None
blob_uri_thumbnail: Optional[str] = None
watermark_uri: Optional[str] = None
captured_date: datetime.datetime = datetime.datetime(1, 1, 1)
captured_by_contact_id: Optional[str] = None
captured_by_contact_name: Optional[str] = None
captured_by_contact_thumbnail_url: Optional[str] = None
notes: Optional[str] = None
resource_action_name: Optional[str] = None
location_verified: Optional[str] = None
traffic_light_location_verified: Optional[str] = None
audience_level: Optional[str] = None
works_for: Optional[str] = None
# @ApiResponse(Description="Returns list of attachments linked to an object.")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetAttachmentsResponse:
attachments: Optional[List[MediaModel]] = None
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetAttachments:
# @ApiMember(DataType="Guid", Description="Object for which primary image is to be uploaded.", IsRequired=true, Name="ConnectedObjectId")
connected_object_id: Optional[str] = None
"""
Object for which primary image is to be uploaded.
"""
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/{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"}}}