getAttachmentById method

Future<Attachment> getAttachmentById({
  1. required String id,
  2. int? version,
})

Returns a specific attachment.

Permissions required: Permission to view the attachment's container.

Implementation

Future<Attachment> getAttachmentById(
    {required String id, int? version}) async {
  return Attachment.fromJson(await _client.send(
    'get',
    'attachments/{id}',
    pathParameters: {
      'id': id,
    },
    queryParameters: {
      if (version != null) 'version': '$version',
    },
  ));
}