Skip to content

m8ty_client_bankdocuments

m8ty_client_bankdocuments solves this by providing typed access to documents, categories, attachments, and read status, so apps can organize and surface bank communications in one place.

Bank Documents information service covers all the aspects of bank documents, attachments, and categories.

Check the documentation of the m8ty_client_bankdocuments library to get an idea about the available models and their properties.

import 'package:dio/dio.dart';
import 'package:m8ty_client_bankdocuments/m8ty_client_bankdocuments.dart';
import 'package:m8ty_client_common/m8ty_client_common.dart';
import 'package:built_collection/built_collection.dart';
final client = M8tyClientBankdocuments();
client.setOAuthToken('ApiOAuth2', oauthToken);
Method Description
searchBankDocuments Get user bank documents
getBankDocumentById Get bank document by id
deleteBankDocuments Delete bank documents
markDocumentsAsRead Mark bank documents as read by the user
Method Description
getAttachmentById Get a specific document attachment by its identifier
Method Description
getAllDocumentCategories Get all available bank-document categories

Here some examples how the dart client can be used

final client = M8tyClientBankdocuments();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getBankDocumentsApi();
final searchBankDocumentsRequest = SearchBankDocumentsRequestModel((b) => b
..customerId = "123"
..categoryType = BankDocumentCategoryTypeModel.PAYMENT_CATEGORY
..readStatus = SearchBankDocumentsRequestModelReadStatusEnum.UNREAD,
);
final Response<BankDocumentsPageModel> documents = await api.searchBankDocuments(
searchBankDocumentsRequestModel: searchBankDocumentsRequest,
page: 1,
size: 100,
);
final client = M8tyClientBankdocuments();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getBankDocumentsApi();
final Response<BankDocumentModel> document = await api.getBankDocumentById(
bankDocumentId: "1234",
);
final client = M8tyClientBankdocuments();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCategoriesApi();
final Response<BuiltList<DocumentCategoryModel>> categories = await api.getAllDocumentCategories();
final client = M8tyClientBankdocuments();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getAttachmentsApi();
try {
final Response<Uint8List> attachment = await api.getAttachmentById(
bankDocumentId: "123",
attachmentId: "4567",
);
File file = File("/temp/myfile");
await file.writeAsBytes(attachment.data!);
} on DioException catch (e) {
throw Exception(
'Request failed (status: ${e.response?.statusCode}): ${e.response?.data}',
);
}