GetReport not working with Node.js

Hello,
I get an error when calling getReport ( or getReportAsCSV ).
{
statusCode: 404,
errorCode: 1006,
message: 'Not Found',
refId: 'lrrf81wvdugg'
}
The id exists ( I have double checked by calling ss.sheets.listSheets )
Here is the code I am using ( node.js )
var client = require('smartsheet');
var fs = require("fs")
// Set options
var options = {
id: 8702473624938372
};
var ss = client.createClient({ accessToken: "****************" });
// Get report
ss.reports.getReport(options)
.then(function(report) {
console.log(report);
})
.catch(function(error) {
console.log(error);
});
Thanks for your help
Answers
-
Hi @fredougo
Are you trying to get a Sheet or a Report? These are two different Smartsheet items.
From the URL it looks like the item you're looking to retrieve data from is actually a Sheet type of Smartsheet item. This means the Get Report API call will error since no Report exists with that specific ID.
Try using Get Sheet (see here) instead!
Cheers,
Genevieve
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
-
Thanks Genevieve, you solved my problem!
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67K Get Help
- 441 Global Discussions
- 154 Industry Talk
- 502 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 156 Just for fun
- 79 Community Job Board
- 512 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 307 Events
- 36 Webinars
- 7.3K Forum Archives