The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

can't handle JSON returned by Trello API on JS

José_Chavez
May 25, 2020

So I'm working on a simple .html file .

I'm making the query:

var toDo= Trello.get('/lists/5d3ef8543a911e79f63df8c0/cards');

And I'm calling:

console.log(toDo);

And I'm getting image.png

So my problem is that I need to acces the responseJSON atributte, and I dont know ho to do it.

I already tried with toDo.responseJSON but it returns 'undefined'

How can I handle this type of JSON?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Iain Dooley
Community Champion
May 26, 2020

@José_Chavez in order to figure out the structure of a javascript object, you can use:

for(var key in toDo)
{
    console.log(key+" has value: "+object[key]);
}

What you will probably find is that responseJSON is actually the member of another key in the object, so you'll have to address it like toDo.somethingelse.responseJSON

TAGS
AUG Leaders

Atlassian Community Events