title: Trello attachment download returning 401 unauthorized permission requested
body: <p>I have a simple script that attempts to download attachments on cards that include &quot;template&quot; as a prefix and are an svg.</p>
  <p>I generated my token with <a href="https://trello.com/1/authorize?expiration=never&amp;scope=read,write&amp;response_type=token&amp;key=MYKEY" rel="nofollow noreferrer">https://trello.com/1/authorize?expiration=never&amp;scope=read,write&amp;response_type=token&amp;key=MYKEY</a>.</p>
  <p>I'm aware of the access to S3 announcement <a href="https://community.developer.atlassian.com/t/authenticated-access-to-s3/40647" rel="nofollow noreferrer">https://community.developer.atlassian.com/t/authenticated-access-to-s3/40647</a>.</p>
  <pre><code>trello.get(&quot;/1/lists/{idList}/cards&quot;, (err, data) =&gt; {
    for (const card of data) {
      trello.get(&quot;/1/cards/&quot; + card.id + &quot;/attachments&quot;, (err, data) =&gt; {
        for (const file of data) {
          if (file.mimeType != &quot;image/svg+xml&quot;) {
            continue;
          }
  
          const prefix = file.name.split(&quot;-&quot;)[0];
  
          if (prefix === &quot;template&quot;) {
            trello.get(
              &quot;/1/cards/&quot; +
                card.id +
                &quot;/attachments/&quot; +
                file.id +
                &quot;/download/&quot; +
                file.name,
              (err, data) =&gt; {
                console.log(data);
              }
            );
          }
        }
      });
    }
  });
  </code></pre>
  <p>I then get a 401 unauthorized permission requested and I'm unsure why. Is this something to do with my trello subscription (14 day trial) or some setting in trello. What am I missing?</p>
  <p>Thanks</p>