Adding Sheet to Report using API
After some trouble with this command line string. I am getting a 1006 error even though I am the Owner of the Report and Owner of the Sheet that I am trying to insert. I can do this manually without any issues. Any thoughts?
curl -H "Authorization: Bearer TOKENHERE" -H "Content-Type: application/json" -X POST "https://api.smartsheet.com/2.0/reports/REPORDIDhere/sheets" -d '{"sheetId":"SheetIDhere"}'
I get:
{
"errorCode" : 1006,
"message" : "Not Found",
"refId" : "u9yqdu"
}
Answers
-
Also give same error when I try this way in PowerShell:
$reportId = "1234567890"
$sheetIdToAdd = "0987654321"
$accessToken = "MYTOKENISHERE"$headers = @{
"Authorization" = "Bearer $accessToken"
"Content-Type" = "application/json"
}$body = @{
"sheetId" = $sheetIdToAdd
} | ConvertTo-JsonInvoke-WebRequest -Uri "https://api.smartsheet.com/2.0/reports/$reportId/sheets" -Method Post -Headers $headers -Body $body
Gets me this:
Invoke-WebRequest : { "errorCode" : 1006, "message" : "Not Found", "refId" : "vkcumt" }
At line:1 char:1- Invoke-WebRequest -Uri "https://api.smartsheet.com/2.0/reports/$repor ...
- + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
-
The Smartsheet API does not currently have a Report method that adds sheets to a Report - you can see a list of the actions you can take in the documentation, here:
Please add your vote to this Product Idea to let the Product team know this is an important functionality for you: Update Reports using the API
Cheers,
GenevieveNeed more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives