-
-
Notifications
You must be signed in to change notification settings - Fork 4
AddAttachmentToCardAsync
Rasmus Wulff Jensen edited this page Nov 1, 2023
·
4 revisions
Delete an Attachments on a card
/// <summary>
/// Add an Attachment to a Card
/// </summary>
/// <param name="cardId">Id of the Card</param>
/// <param name="attachmentUrlLink">A Link Attachment</param>
/// <param name="cancellationToken">Cancellation Token</param>
/// <returns>The Created Attachment</returns>
public async Task<Attachment> AddAttachmentToCardAsync(string cardId, AttachmentUrlLink attachmentUrlLink, CancellationToken cancellationToken = default) {...}/// <summary>
/// Add an Attachment to a Card
/// </summary>
/// <param name="cardId">Id of the Card</param>
/// <param name="attachmentUrlLink">A Link Attachment</param>
/// <param name="cancellationToken">Cancellation Token</param>
/// <returns>The Created Attachment</returns>
public async Task<Attachment> AddAttachmentToCardAsync(string cardId, AttachmentUrlLink attachmentUrlLink, CancellationToken cancellationToken = default) {...}var cardId = "63c939a5cea0cb006dc9e958";
//Add URL Link Attachment
Attachment urlAttachment = await _trelloClient.AddAttachmentToCardAsync(cardId, new AttachmentUrlLink("https://www.google.com", "Google Search"));
//Add File Attachment
Stream stream = File.OpenRead(@"D:\test.txt");
string filename = "test.txt";
string name = "My Optional Name for the File";
var fileAttachment = await _trelloClient.AddAttachmentToCardAsync(cardId, new AttachmentFileUpload(stream, filename, name));
If you are looking for info on a specific method in TrelloDotNet then expand the Pages above and input the 'MethodName' (Example: 'AddCardAsync')