Platform API

<back to all web services

GetMediaImages

Requires Authentication
The following routes are available for this service:
All Verbs/api/mediaImages/{ObjectId}
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 images linked to an object.")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetMediaImagesResponse:
    images: Optional[List[MediaModel]] = None
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetMediaImages:
    # @ApiMember(DataType="Guid", Description="Object for which primary image is to be uploaded.", IsRequired=true, Name="ObjectId")
    object_id: Optional[str] = None
    """
    Object for which primary image is to be uploaded.
    """

Python GetMediaImages 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/mediaImages/{ObjectId} HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"ObjectId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Images":[{"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"}}}