ClubManager.Api

<back to all web services

FileAttachmentService.GetFileRequest

Requires Authentication
The following routes are available for this service:
POST,GET/api/FileAttachment/GetFile
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class FileAttachmentData implements IConvertible
{
    int? FileAttachmentId;
    int? BranchId;
    int? UploadedByUserId;
    Uint8List? FileData;
    String? InstanceType;
    int? InstanceId;
    String? Filename;
    int? FileSize;
    String? MimeType;
    Uint8List? Thumbnail;

    FileAttachmentData({this.FileAttachmentId,this.BranchId,this.UploadedByUserId,this.FileData,this.InstanceType,this.InstanceId,this.Filename,this.FileSize,this.MimeType,this.Thumbnail});
    FileAttachmentData.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FileAttachmentId = json['FileAttachmentId'];
        BranchId = json['BranchId'];
        UploadedByUserId = json['UploadedByUserId'];
        FileData = JsonConverters.fromJson(json['FileData'],'Uint8List',context!);
        InstanceType = json['InstanceType'];
        InstanceId = json['InstanceId'];
        Filename = json['Filename'];
        FileSize = json['FileSize'];
        MimeType = json['MimeType'];
        Thumbnail = JsonConverters.fromJson(json['Thumbnail'],'Uint8List',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FileAttachmentId': FileAttachmentId,
        'BranchId': BranchId,
        'UploadedByUserId': UploadedByUserId,
        'FileData': JsonConverters.toJson(FileData,'Uint8List',context!),
        'InstanceType': InstanceType,
        'InstanceId': InstanceId,
        'Filename': Filename,
        'FileSize': FileSize,
        'MimeType': MimeType,
        'Thumbnail': JsonConverters.toJson(Thumbnail,'Uint8List',context!)
    };

    getTypeName() => "FileAttachmentData";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.clubmanagercentral.com', types: <String, TypeInfo> {
    'FileAttachmentData': TypeInfo(TypeOf.Class, create:() => FileAttachmentData()),
    'Uint8List': TypeInfo(TypeOf.Class, create:() => Uint8List(0)),
});

Dart FileAttachmentService.GetFileRequest DTOs

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

HTTP + XML

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

POST /api/FileAttachment/GetFile HTTP/1.1 
Host: api.clubmanagercentral.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<FileAttachmentService.GetFileRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubManager.Api.Services">
  <FileAttachmentId>0</FileAttachmentId>
</FileAttachmentService.GetFileRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FileAttachmentData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubManager.Interfaces.Models.FileAttachment">
  <BranchId>0</BranchId>
  <FileAttachmentId>0</FileAttachmentId>
  <FileData>AA==</FileData>
  <FileSize>0</FileSize>
  <Filename>String</Filename>
  <InstanceId>0</InstanceId>
  <InstanceType>String</InstanceType>
  <MimeType>String</MimeType>
  <Thumbnail>AA==</Thumbnail>
  <UploadedByUserId>0</UploadedByUserId>
</FileAttachmentData>