Question
I'm trying to request all of the boards that my account is in. When I make the request, I do it to a custom class package that I made. I know that it works because it does return something, but I just am not sure where to look for the actual information about my boards.
Code
This is where I am pointing my request to.
GET https://api.trello.com/1/members/me/boards?fields=name,url&key=${this.key}&token=${this.token}
This is what I my package is using to make the request.
getBoards(callback) {
fetch(`https://api.trello.com/1/members/me/boards?fields=name,url&key=${this.key}&token=${this.token}`,{
method: 'GET'
})
.then(r => {
callback(r,false)
})
.catch(e => {
callback(null,e)
})
}
And this is what I am using to request the package's function.
const boards = trello.getBoards((boards,err) => {
if (err) {
console.log(err);
} else {
// do stuff with the boards
}
})
Results
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: Gunzip {
_writeState: [Uint32Array],
_readableState: [ReadableState],
readable: true,
_events: [Object: null prototype],
_eventsCount: 6,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: true,
_transformState: [Object],
_hadError: false,
bytesWritten: 0,
_handle: [Zlib],
_outBuffer: <Buffer 5b 7b 22 6e 61 6d 65 22 3a 22 44 69 73 63 70 6c 69 6e 65 20 44 61 74 61 62 61 73 65 22 2c 22 69 64 22 3a 22 35 66 61 38 30 63 34 61 61 64 66 30 39 61 ... 16334 more bytes>,
_outOffset: 0,
_chunkSize: 16384,
_defaultFlushFlag: 2,
_finishFlushFlag: 2,
_defaultFullFlushFlag: 3,
_info: undefined,
_level: -1,
_strategy: 0,
[Symbol(kCapture)]: false
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://api.trello.com/1/members/me/boards?fields=name,url&key=xxxxxxxx&token=xxxxxxxx',
status: 200,
statusText: 'OK',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
}
I have four boards and am looking for the ID of a specific board. Does anybody know what this returns? Thanks in advance.