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
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives