Platform API

<back to all web services

SaveMedia

Requires Authentication
The following routes are available for this service:
All Verbs/api/json/reply/savemedia
All Verbs/api/media
All Verbs/api/media/userprofile
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 SaveMediaResponse:
    # @ApiMember(DataType="Guid", Description="Media File Guid", Name="ErosMediaFileId", ParameterType="query")
    eros_media_file_id: Optional[str] = None
    """
    Media File Guid
    """


    # @ApiMember(DataType="string", Description="Media File Name", Name="MediaName", ParameterType="query")
    media_name: Optional[str] = None
    """
    Media File Name
    """


    # @ApiMember(DataType="string", Description="The original name of the media being saved.", Name="OriginalFileName", ParameterType="query")
    original_file_name: Optional[str] = None
    """
    The original name of the media being saved.
    """


    # @ApiMember(DataType="string", Description="Url of the media file.", Name="MediaFileUrl", ParameterType="query")
    media_file_url: Optional[str] = None
    """
    Url of the media file.
    """


    # @ApiMember(DataType="string", Description="Url of the media file thumbnail.", Name="MediaFileThumbnailUrl", ParameterType="query")
    media_file_thumbnail_url: Optional[str] = None
    """
    Url of the media file thumbnail.
    """


    # @ApiMember(DataType="ResponseStatus", Description="Service Stack Response Status.", Name="ResponseStatus", ParameterType="query")
    response_status: Optional[ResponseStatus] = None
    """
    Service Stack Response Status.
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SaveMedia:
    # @ApiMember(DataType="Guid", Description="The media file Id to use.", Name="MediaFileId", ParameterType="query")
    media_file_id: Optional[str] = None
    """
    The media file Id to use.
    """


    media_name: Optional[str] = None
    media_captured: datetime.datetime = datetime.datetime(1, 1, 1)
    # @ApiMember(DataType="Guid", Description="The licensee's contact Id linked to the media file.", IsRequired=true, Name="ContactId", ParameterType="query")
    contact_id: Optional[str] = None
    """
    The licensee's contact Id linked to the media file.
    """


    # @ApiMember(DataType="Guid", Description="The id of the session in which the media file was created.", IsRequired=true, Name="SessionId", ParameterType="query")
    session_id: Optional[str] = None
    """
    The id of the session in which the media file was created.
    """


    appliance_id: Optional[str] = None
    container_name: Optional[str] = None
    image_width: Optional[int] = None
    image_height: Optional[int] = None

Python SaveMedia DTOs

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

HTTP + JSV

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

POST /api/json/reply/savemedia HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	MediaName: String,
	MediaCaptured: 0001-01-01,
	ContainerName: String,
	ImageWidth: 0,
	ImageHeight: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	MediaName: String,
	OriginalFileName: String,
	MediaFileUrl: String,
	MediaFileThumbnailUrl: String,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}