Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Getting card description via Node JS

TrelloXinterface September 6, 2020

I've been trying to fetch the only description of a card using Node JS.

`The text below is from Trello REST API Get Card

const fetch = require('node-fetch');

fetch('https://api.trello.com/1/cards/{id}?key=0471642aefef5fa1fa76530ce1ba4c85&token=9eb76d9a9d02b8dd40c2f3e5df18556c831d4d1fadbe2c45f8310e6c93b5c548', {
  method: 'GET',
  headers: {
    'Accept': 'application/json'
  }
})
  .then(response => {
    console.log(
      `Response: ${response.status} ${response.statusText}`
    );
    return response.text();
  })
  .then(text => console.log(text))
  .catch(err => console.error(err));


I've been trying to only get the response to be the card description.

Yes, I've entered "fetch('https://api.trello.com/1/cards/{id}?key=0471642aefef5fa1fa76530ce1ba4c85&token=9eb76d9a9d02b8dd40c2f3e5df18556c831d4d1fadbe2c45f8310e6c93b5c548'" part correctly. I get the full json file. I am trying to only output the description. 

Tried:  `Response: ${response.desc}` and so on. No outcome.

 

 

1 answer

0 votes
Iain Dooley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 6, 2020

@TrelloXinterface so you get no status, and no error? Generally you should be able to at least get an HTTP error when posting to the API if something's not right.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events