# Issues with downloading attachments from cards. 401 error through REST API using RestSharp

**URL:** <https://community.developer.atlassian.com/t/issues-with-downloading-attachments-from-cards-401-error-through-rest-api-using-restsharp/64179>\
**Category:** Trello\
**Tags:** rest-api\
**Created:** [December 9, 2022, 3:13am UTC](https://community.developer.atlassian.com/t/issues-with-downloading-attachments-from-cards-401-error-through-rest-api-using-restsharp/64179 "2022-12-09T03:13:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LucasTinius](https://avatars.discourse-cdn.com/v4/letter/l/f475e1/32.png) [@LucasTinius](https://community.developer.atlassian.com/u/LucasTinius)\
**Post date:** [December 9, 2022, 3:13am UTC](https://community.developer.atlassian.com/t/issues-with-downloading-attachments-from-cards-401-error-through-rest-api-using-restsharp/64179/1 "2022-12-09T03:13:35Z")

</div>

So I am trying to create an application that will enable me to input a string and search every card on a specific board for that string in the card names. Once it does that I am creating a new directory on the local server and I want to download all attachments into the new directory. I have everything working as desired with the exception of downloading the attached files. I am getting a 401 error about unauthorized access request.

The fact that I am using RestSharp and scripting in C# which there isn’t really any documentation for the Trello API, but I have attempted to make a request using the methods that I saw listed in this announcement:

> [@Update: Authenticated Access to S3](https://community.developer.atlassian.com/t/update-authenticated-access-to-s3/43681):
>
> tl;dr Trello will begin requiring API key and token authorization via the [Authorization header](https://developer.atlassian.com/cloud/trello/guides/rest-api/authorization/#passing-token-and-key-in-api-requests) to access card attachment download URLs. Update: This was [previously announced](https://trello.com/c/oIHLR6b1/85-authenticated-access-to-s3) but the implementation has changed enough that we are re-announcing. Query parameter-based authorization will be turned off on January 25, 2021. The manually built /download/ routes we previously recommended continue to be our recommendation moving forward. We will be reaching out directly to developers who are using query…

Now, one thing that is different for me from the above announcement is that I am not getting a signature at the end of the URL when I make the call to get the attachment information. So I may be doing things a little wrong. I am just in need of some help, because I have no idea what I could be doing incorrectly.

I also don’t know if any of you have experience or have interacted with RestSharp, but it is essentially a wrapper for the HttpClient class in C#. Any help would be greatly appreciated.

Thanks.
