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 .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/FileAttachment/GetFile HTTP/1.1 
Host: api.clubmanagercentral.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"FileAttachmentId":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"FileAttachmentId":0,"BranchId":0,"UploadedByUserId":0,"FileData":"AA==","InstanceType":"String","InstanceId":0,"Filename":"String","FileSize":0,"MimeType":"String","Thumbnail":"AA=="}