swagger: '2.0' x-asee-visibility: public info: version: v1 title: Correspondence API description: | Correspondence API handles the automated generation of batches of pre-formatted correspondence, typically integrating customer/product specific data in correspondence templates for variable aspects of content. Channel applications can use this API to deliver alerts, reminders, advices, past due notices, announcements, campaign offers, statements and other arrangement reports. Correspondence API also offers rendering of documents in .pdf and .docx formats from predefined templates and supplied data. For self-service applications such as mobile or web, Correspondence API offers virtual mailbox for private exchange of messages between bank and customer. Last, but not least, customer notifications preferences are maintained so that notifications of interest to customer are delivered over preferred channels. contact: name: Jovica Filipovic url: https://bankapi.net/docs/public/correspondence-getstarted.html email: jovica.filipovic@asseco-see.rs host: bankapi.net basePath: /v1/correspondence schemes: - https - http consumes: - application/json produces: - application/json tags: - description: Working with communications name: Communications - description: Working with templates name: Templates - description: Working with mailbox name: Mailbox - description: Working with notification preferences name: Preferences - description: Working with classifications name: Classifications paths: /communications: get: summary: Get the list of communications for delivery description: Response contains list of communications that match filters. tags: - Communications operationId: Communications_GetList parameters: - $ref: '#/parameters/contact-medium-param' - $ref: '#/parameters/delivery-statuses-param' - $ref: '#/parameters/page-size-param' - $ref: '#/parameters/page-number-param' - $ref: '#/parameters/sort-order-param' - $ref: '#/parameters/sort-by-param' responses: '200': description: OK schema: $ref: '#/definitions/communication-list' default: $ref: '#/responses/default-error-response' x-asee-tags: - Pageable - Sortable post: summary: Schedule communication for delivery tags: - Communications operationId: Communications_Initiate parameters: - description: The initiate delivery command. in: body name: cmd required: true schema: $ref: '#/definitions/initiate-communication-command' responses: '201': description: Communication initiated schema: $ref: '#/definitions/resource-created-result' headers: Location: description: URI where communication details can be obtained type: string format: uri default: $ref: '#/responses/default-error-response' x-asee-tags: [] /communications/statuses: post: summary: Update delivery statuses of multiple communications tags: - Communications operationId: Communications_UpdateStatuses parameters: - name: cmd in: body description: Update delivery statuses command required: true schema: $ref: '#/definitions/update-delivery-statuses-command' responses: '204': description: No content - Communication status updated default: $ref: '#/responses/default-error-response' x-asee-tags: [] /templates/render: post: summary: Render formatted content based on template tags: - Templates operationId: Templates_Render parameters: - description: Renders document. in: body name: cmd required: true schema: $ref: '#/definitions/render-content-command' responses: '200': description: OK headers: Content-Type: description: "Standard http header field that indicates the media type of the body content sent to the recipient. Example: `application/pdf`" type: string Content-Disposition: description: "Standard http header field that conveys additional information about how to process the response payload, and also can be used to attach additional metadata, such as the filename to use when saving the response payload locally. Example: `inline;filename=offer.pdf`. For more details see [RFC6266](https://tools.ietf.org/html/rfc6266)" type: string schema: type: file default: $ref: '#/responses/default-error-response' x-asee-tags: [] /me/messages: get: summary: Get mailbox messages for authenticated user tags: - Mailbox operationId: MailboxMessages_GetList parameters: - $ref: '#/parameters/from-time-param' - $ref: '#/parameters/to-time-param' - $ref: '#/parameters/mailbox-statuses-param' - $ref: '#/parameters/message-categories-param' - $ref: '#/parameters/page-size-param' - $ref: '#/parameters/page-number-param' - $ref: '#/parameters/sort-order-param' - $ref: '#/parameters/sort-by-param' - $ref: '#/parameters/trim-param' - $ref: '#/parameters/include-param' responses: '200': description: OK schema: $ref: '#/definitions/mailbox-message-list' default: $ref: '#/responses/default-error-response' x-asee-tags: - Pageable - Sortable - Shapeable /me/messages/{message-id}: get: summary: Get specific message tags: - Mailbox operationId: MailboxMessages_Get parameters: - $ref: '#/parameters/message-id-param' responses: '200': description: OK schema: $ref: '#/definitions/mailbox-message' default: $ref: '#/responses/default-error-response' /me/messages/summary: get: summary: Get mailbox summary for authenticated user tags: - Mailbox operationId: MailboxMessages_Summary_Get parameters: - $ref: '#/parameters/mailbox-statuses-param' responses: '200': description: OK schema: $ref: '#/definitions/mailbox-summary' default: $ref: '#/responses/default-error-response' x-asee-tags: [] /me/messages/{message-id}/mark-as-read: post: summary: Mark message as read tags: - Mailbox operationId: MailboxMessages_MarkAsRead parameters: - $ref: '#/parameters/message-id-param' responses: '204': description: No content - Marked as read default: $ref: '#/responses/default-error-response' /me/messages/archive: post: summary: Archive mailbox messages tags: - Mailbox operationId: MailboxMessages_Archive parameters: - name: cmd in: body description: Archive messages command required: true schema: $ref: '#/definitions/archive-messages-command' responses: '204': description: No content - Archived default: $ref: '#/responses/default-error-response' /me/notification-preferences: get: summary: Get notification preferences for authenticated user description: Response contains notifications preferences with thresholds and channel preferences tags: [Preferences] operationId: NotificationPreferences_Get responses: '200': description: OK schema: $ref: '#/definitions/preference-list' default: $ref: '#/responses/default-error-response' post: summary: Change notification preferences for authenticated user description: Sets notification preference for user. Preference for certain notification may apply to specific account. Only changed preferences should be supplied within a command. tags: [Preferences] operationId: NotificationPreferences_Set parameters: - name: cmd in: body description: Set notification preferences command required: true schema: $ref: '#/definitions/set-preferences-command' responses: '204': description: No content - preferences set default: $ref: '#/responses/default-error-response' /notification-groups: get: summary: List predefined notification groups description: Response contains list of predefined notification groups with default settings for channels, threshold and freequency tags: [Preferences] operationId: NotificationGroups_Get responses: '200': description: OK schema: $ref: '#/definitions/notification-group-list' default: $ref: '#/responses/default-error-response' # ****************************************************# # ENDPOINTS COMMON WITH OTHER APIs # # ****************************************************# /classifications: get: summary: List all classification schemas used by the API description: Some fields and parameters have been restricted to a list of allowed lookup values maintained by the bank. This method lists all schemas used in this API. operationId: "Classifications_GetList" responses: '200': description: Success schema: $ref: '#/definitions/classification-list' default: $ref: '#/responses/default-error-response' tags: - Classifications /classifications/{schema-id}: get: summary: List values allowed by given classification schema. description: Returns all classification values for chosen classification. operationId: Classifications_Get parameters: - $ref: '#/parameters/schema-id-param' responses: '200': description: OK schema: $ref: '#/definitions/classification' default: $ref: '#/responses/default-error-response' tags: - Classifications parameters: schema-id-param: name: schema-id description: Identifier of classification schema in: path required: true type: string from-time-param: name: from-time in: query description: Time of the first communication to be returned. type: string required: false format: date-time to-time-param: name: to-time in: query description: Date of last transaction. Default value is today. type: string required: false format: date-time contact-medium-param: name: contact-medium in: query description: | Contact medium designated for the delivery of the communication For a list of allowed values see [contact-medium](correspondence-classifications.html#contact-medium) enumeration. type: string required: true enum: - smartphone-push - email - virtual-inbox - sms x-asee-enum: contact-medium include-param: description: List of fields to include in response. For more information see general guidance on [response shaping](common-getstarted.html#shaping) in: query name: include type: array items: type: string collectionFormat: csv x-asee-common: true trim-param: description: List of fields to trim from response. For more information see general guidance on [response shaping](common-getstarted.html#shaping) in: query name: trim type: array items: type: string collectionFormat: csv x-asee-common: true page-size-param: name: page-size in: query description: Number of items on a page. For more information see general guidance on [paging and sorting]() required: false format: int32 type: integer default: 10 x-asee-common: true page-number-param: in: query name: page description: Page index. For more information see general guidance on [paging and sorting]() required: false format: int32 type: integer x-asee-common: true sort-order-param: description: Sort order (`asc` or `desc`). Default is asc. For more information see general guidance on [paging and sorting]() in: query name: sort-order type: string default: asc enum: - asc - desc x-asee-common: true sort-by-param: description: Attribute of the collection item to sort by. For more information see general guidance on [paging and sorting](). in: query name: sort-by type: string required: false delivery-statuses-param: description: Delivery status of the communication. in: query name: statuses required: true items: type: string enum: - pending - sent - delivered - delivery-failed - archived type: array collectionFormat: csv mailbox-statuses-param: description: Mailbox status of the communication in: query name: statuses required: true items: type: string enum: - received - read - archived type: array collectionFormat: csv message-categories-param: description: "Categories that group similar messages. See [Message Category](correspondence-classifications.md#message-category) classification" in: query name: categories required: false collectionFormat: csv items: type: string type: array communication-id-param: description: The unique identifier of the communication in: path name: communication-id required: true type: string message-id-param: description: The unique identifier of the mailbox message in: path name: message-id required: true type: string definitions: # ****************************************************# # DEFINITIONS OF MODELS COMMON WITH OTHER APIs # # ****************************************************# classification-value: type: object description: Classification value properties: literal: description: Literal that uniquely identifies classification value type: string code: description: Optional numerical code of classification value type: string description: description: Description of classification value type: string parent-literal: description: Optional literal of parent classification value if schema is hierarchical type: string example: literal: billing code: 2 description: Contact may be used to provide party with details of their liabilities to the bank classification-list: description: List of classification schemas type: object properties: items: description: List of classification schemas items: $ref: "#/definitions/classification-info" type: array example: - schema-id: filing-purpose name: Filing Purpose description: List of possible uses of document in business context. Commonly used filing purposes are document, customer-picture - schema-id: folder-purpose name: Folder Purpose description: List of possible uses of a folder in business context. classification-info: description: Basic information on classification schema properties: schema-id: type: string description: Unique literal that identifies the classification schema. Always in `lowercase-dash` convention. name: type: string description: User friendly name of classification description: type: string description: Description of a classification example: schema-id: filing-purpose name: Filing Purpose description: List of possible uses of document in business context. Commonly used filing purposes are document, customer-picture classification: type: object description: Classification schema details properties: schema-id: type: string description: Unique literal that identifies the classification schema. Always in `lowercase-dash` convention. name: type: string description: User friendly name of classification description: type: string description: Description of a classification values: description: List of allowed classification values type: array items: $ref: "#/definitions/classification-value" example: schema-id: contact-purpose name: Contact Purpose description: List of possible uses of contact in business context. Commonly used filing purposes are billing, marketing values: - literal: billing code: 1 description: Contact may be used to provide party with details of their liabilities to the bank - literal: marketing code: 2 description: Contact may be used to provide party with details of offers - literal: reporting code: 3 description: Contact may be used to provide party with reports on their account paged-list: description: List with support for paging and sorting. properties: total-count: description: Total number of items in collection. type: integer page-size: description: Size of the page. type: integer page: description: Index of current page. type: integer total-pages: description: Total number of pages of set size. type: integer sort-order: description: Sort order (`asc` or `desc`). Default is asc. type: string enum: - asc - desc sort-by: description: Attribute of the collection item to sort by. type: string # ****************************************************# # DEFINITIONS SPECIFIC TO CORRESPONDENCE API # # ****************************************************# communication-list: description: List of communications. allOf: - $ref: '#/definitions/paged-list' properties: items: description: List of communication items. items: $ref: '#/definitions/communication' type: array type: object example: total-count: 455 page-size: 10 page-number: 1 total-pages: 46 items: - communication-id: id1 contact: contact1 customer-number: "143434" created: 2016-02-01T01:25:00 status: sent sent: 2016-02-01T01:26:00 expires: 2016-02-02T01:25:00 message-kind: kind1 priority: low retry-count: 5 message: title: Text/image contents body: content-type: text/html content: MessageContent1 attachments: items: - content-type: image/png name: Image content content-url: https://www.content_1.com/con?v=NHdGvx9gZts - content-type: text/plain name: Text content content-url: https://www.content_2.com/con?v=NHdGdfsfsdfgZts - communication-id: id2 contact: contact2 customer-number: "423423" created: 2016-02-01T01:28:00 status: pending sent: 2016-02-01T01:30:00 expires: 2016-02-01T01:31:00 message-kind: kind2 priority: medium retry-count: 5 message: title: Text/image contents body: content-type: text/plain content: MessageContent1 attachments: items: - content-type: image/png name: Image content content-url: https://www.content_3.com/con?v=NHdrhrtgZts - content-type: text/plain name: Text Content content-url: https://www.content_4.com/con?v=NHdGvx9g234sdfsdfsg communication: description: "Identifies a record of the receiving or sending (or the intention to send) of a message between bank and its customers. Content of the communication is linked to the communication record. A communication can use any contact-medium such as a telephone call, a letter, a fax, an e-mail, electronic message, a meeting, etc. It may have occurred or be planned to occur in the future. In each case, a discrete occurrence of a communication is identifiable. Correspondence which takes place over a period of time is not a single communication but is modeled as a series of individual related communications." properties: communication-id: description: Unique identifier of the communication. type: string contact: description: Contact information. $ref: '#/definitions/contact' customer-number: description: Unique identifier of the customer. type: string created: description: Time and date when communication was created. format: date-time type: string status: description: Delivery status of the communication. enum: - pending - retrieved - sent - delivered - failed type: string sent: description: Time and date when communication was sent. format: date-time type: string expires: description: The expiration time and date. Date and time until communication is valid. format: date-time type: string message-kind: description: Unique kind of notification. See [Message Kind](correspondence-classifications.md#message-kind) type: string priority: description: Priority of the message. enum: - high - medium - low type: string retry-count: description: The number of retries to send a message. format: int32 type: integer message: description: Message to be sent. $ref: '#/definitions/formatted-message' type: object example: communication-id: id1 contact: contact1 customer-number: "432845" created: 2016-02-01T01:25:00 status: sent sent: 2016-02-01T01:28:00 expires: 2016-03-01T01:25:00 message-kind: kind1 priority: low retry-count: 5 message: title: Text/image contents body: content-type: text/html content: MessageContent1 attachments: items: - content-type: image/png name: Image content content-url: https://www.content_1.com/con?v=NHdGvx9gZts - content-type: text/plain name: Text content content-url: https://www.content_2.com/con?v=NHdGdfsfsdfgZts contact: description: Information about contact. properties: usage: description: | Provides the context of use for this contact information. For a list of possible values see [contact-usage](correspondence-classifications.html#contact-usage) enumeration. enum: - seasonal - assistant - work - home - default - business - legal type: string kind: description: Kind of contact for direct communication receiving on. enum: - email - sms type: string details: description: Details related to contact. type: string contact-preference: description: Contact preferences including preferred language and list of services that customer wishes or doesn't wish to receive information for. $ref: '#/definitions/contact-preference' uri: type: string type: object mailbox-message-list: description: List of mailbox messages allOf: - $ref: '#/definitions/paged-list' properties: items: description: Mailbox message items: $ref: '#/definitions/mailbox-message' type: array type: object example: total-count: 455 page-size: 10 page-number: 1 total-pages: 46 items: - message-id: id1 customer-number: "123782" received: 2016-02-01T01:25:00 status: received mailbox-folder: folder1 message-kind: kind1 urgency: urgent message: title: Text/image contents body: content-type: text/html content: TextContents attachments: items: - content-type: image/png name: Text content content-url: https://www.content_1.com/con?v=NHdGvx9gZts - content-type: text/plain name: Text content content-url: https://www.content_2.com/con?v=NHdGdfsfsdfgZts message-category: cat1 has-attachments: true is-read: true - message-id: id2 customer-number: "234924" received: 2016-02-01T01:55:00 status: archived mailbox-folder: folder2 message-kind: kind2 urgency: normal message: title: Text/image contents body: content-type: text/html content: ImageContents attachments: items: - content-type: image/png name: Image content content-url: https://www.content_1.com/con?v=NHdGvx9gZts - content-type: text/plain name: Image content content-url: https://www.content_2.com/con?v=NHdGdfsfsdfgZts message-category: cat2 has-attachments: false is-read: true mailbox-message: type: object description: "Message in users virtual mailbox" properties: message-id: description: Unique identifier of mailbox message type: string customer-number: description: Unique identifier of the customer receipient type: string received: description: Time and date when message was received format: date-time type: string status: description: Status of the mailbox message enum: - received - archived type: string mailbox-folder: type: string message-kind: description: Unique kind of notification. See [Message Kind](correspondence-classifications.md#message-kind) type: string urgency: description: Urgency of the message. enum: - urgent - normal type: string message: description: Message content in mailbox $ref: '#/definitions/formatted-message' message-category: description: "Category that groups similar messages. See [Message Category](correspondence-classifications.md#message-category) " type: string has-attachments: type: boolean is-read: type: boolean example: message-id: id2 customer-number: "234924" received: 2016-02-01T01:55:00 status: archived mailbox-folder: folder2 message-kind: kind2 urgency: normal message: title: Text/image contents body: content-type: text/html content: ImageContents attachments: items: - content-type: image/png name: Image content content-url: https://www.content_1.com/con?v=NHdGvx9gZts - content-type: text/plain name: Image content content-url: https://www.content_2.com/con?v=NHdGdfsfsdfgZts message-category: cat2 has-attachments: false is-read: true formatted-message: description: Message consisting of a subject, body and attachments. properties: title: description: The subject of a message, should contain a few words. type: string body: description: Message body contains the complete content of a message and content type (text or html). $ref: '#/definitions/message-body' attachments: description: Content sent along with message, consists of a type of file, name and content. items: $ref: '#/definitions/attachment' type: array type: object contact-preference: description: Contact preferences including preferred language and list of services that customer wishes or doesn't wish to receive information for. properties: preferred-language: description: The language in which customer wants to receive information. type: string opt-ins: description: List of services that customer wishes to receive information for. items: type: string type: array opt-outs: description: List of services that customer does not wishes to receive information for. items: type: string type: array uri: type: string type: object message-body: description: Message body contains the complete content of a message and content type (text or html). properties: content-type: description: Message content type. enum: - text/html - text/plain type: string content: description: The content of a message. type: string type: object attachment: description: Content sent along with message, consists of a type of file, name and content. properties: content-type: description: The type of content that is sent as an attachment. enum: - image/png - image/jpg - application/pdf - application/msword - application/vnd.ms-excel type: string content: description: The content of a attachment. type: string name: description: Attachment name type: string content-url: description: URL where content of attachment is available type: string format: uri type: object update-delivery-statuses-command: description: Update communication status command properties: updates: type: array items: $ref: "#/definitions/communication-status" communication-status: type: object required: - id - status properties: id: type: string format: uuid status: description: Updated delivery status of the communication enum: - retrieved - sent - delivered - failed type: string reason: description: Optional. Reason that explains why communication status changed type: string archive-messages-command: type: object description: Archive messages command properties: older-than: description: Date before which messages will be archived. Default is mesages older than 90 days. Combines with `archive-unread` and `folders` fields. type: string format: date archive-unread: description: Wheather to archive unread messages. Combines with `before-date` and `folders` fields. type: boolean default: false folders: description: Specific folders to archive. If present and not empty, it combines with `before-date` and `archive-unread` type: array items: type: string enum: - inbox - sent message-ids: description: Specific messages to archive. If present and not empty, it takes precedence and other command fields such as `before-date`, `folders`, `archive-unread` will be ignorred. type: array items: type: string mark-as-read-command: description: Mark as read command properties: status-code: description: Delivery status of the communication. enum: - retrieved - sent - delivered - failed - archived type: string status-description: description: Description of the communication status, e.g. the reason why communication has failed. type: string required: - status-code type: object resource-created-result: description: Unique identifier of newly created resource that can be used in future inquires and commands type: string initiate-communication-command: description: The initiate communication delivery command. properties: contact: description: Contact information. $ref: '#/definitions/contact' message-kind: description: Unique kind of the message. type: string data: description: Formated or unformated data type: string template: description: The name of template type: string to-channel: description: The channel on wich communication is sent to. enum: - email - sms type: string from-channel: description: The source from which communication is sent. type: string priority: description: Priority of the communication (high, medium, low). enum: - high - medium - low type: string expires: description: The expiration time and date. Date and time until communication is valid. format: date-time type: string type: object mailbox-summary: description: Summary of mailbox items properties: total-count: type: integer format: int32 items: description: List of mailbox summary items items: $ref: '#/definitions/status-count' type: array type: object example: total-count: 500 items: - status: status1 count: 100 - status: status2 count: 100 status-count: description: Summary item contains total count and count of messages for each status properties: status: description: The status of mailbox mnessage. type: string count: description: Total number of all communications. format: int32 type: integer type: object render-content-command: description: The request for rendering of document. properties: data: description: Provides data source for document rendering. type: string format-type: description: 'The type of output file: pdf, excel or word.' enum: - pdf - excel - word2 type: string template: description: Provides the name of the template for document rendering. type: string required: - format-type - template type: object set-preferences-command: type: object description: Command with parameters to set notification preferences properties: preferences: type: array description: List of notification preferences that are being changed items: $ref: '#/definitions/preference' example: preferences: - customer-number: nodjo-001 notification-group: account-credit threshold: 100 channels: - contact-medium: sms is-enabled: false - contact-medium: email is-enabled: true - contact-medium: push is-enabled: true - customer-number: nodjo-001 arrangement-number: '001200300000121' notification-group: account-balance frequency: P7D channels: - contact-medium: sms is-enabled: false - contact-medium: email is-enabled: true - contact-medium: push is-enabled: true notification-group: type: object properties: group-name: description: Unique identifier notification group type: string default-threshold: description: Default threshold at which events trigger notifications in this group type: integer default-frequency: description: Frequency at which notifications are consolidated and sent. Usualy daily, weekly or monthly, but could be more specific. type: string format: ISO 8601 duration channels: type: array description: List of channels that are enabled or disabled for specific notification group items: $ref: '#/definitions/channel-switch' notification-group-list: type: array items: $ref: '#/definitions/notification-group' example: - group-name: account-credit default-threshold: 100 channels: - contact-medium: sms is-enabled: false - contact-medium: email is-enabled: true - contact-medium: push is-enabled: true - group-name: account-balance default-threshold: 0 default-frequency: P7D channels: - contact-medium: sms is-enabled: false - contact-medium: email is-enabled: true - contact-medium: push is-enabled: true preference-list: type: array items: $ref: '#/definitions/preference' example: - customer-number: nodjo-001 notification-group: account-credit threshold: 100 channels: - contact-medium: sms is-enabled: false - contact-medium: email is-enabled: true - contact-medium: push is-enabled: true - customer-number: nodjo-001 arrangement-number: '001200300000121' notification-group: account-balance frequency: P7D channels: - contact-medium: sms is-enabled: false - contact-medium: email is-enabled: true - contact-medium: push is-enabled: true preference: type: object description: Notification preference set for specific customer, possibly for specific arrengement properties: customer-number: description: Unique identifier of the customer type: string arrangement-number: description: Unique identifier of the account arrangement. Used if preference is targetting specific account. If empty or not present it is interpreted that preference applies to all relevant accounts. type: string notification-group: description: Unique identifier notification group type: string threshold: description: Threshold at which events trigger notifications in this group type: number format: decimal frequency: description: Frequency at which periodic notifications are generated. Usualy daily, weekly or monthly for periodic notifications. If empty or not present instant notifications are asummed. type: string format: ISO 8601 duration channels: type: array description: List of channels that are enabled or disabled for specific notification group items: $ref: '#/definitions/channel-switch' channel-switch: type: object description: Indicates if specific channel contact medium is enabled properties: contact-medium: description: | Contact medium used to deliver notifications. For a list of allowed values see [contact-medium](correspondence-classifications.html#contact-medium) enumeration. type: string enum: [smartphone-push, email, virtual-inbox, sms] x-asee-enum: contact-medium is-enabled: description: Indicates if contact medium is enabled for notification group type: boolean responses: default-error-response: description: 'Besides specific status codes above, other standard http [status codes](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) can be returned for each request. To learn more see general guidance on [common-getstarted.html#error handling]()'