In Smartsheet I have downloaded Published Items list from user management. Using this list I need to change the Access control (Public/Organization) value through api. Please help. Thanks
-
What do the docs say about this scenario? What have you tried so far? – Kim Brandl Jun 29 '22 at 15:14
-
Hi @Kim Brandl thanks for your response. The document ( Published Items) have Id, Type, Owner ,Publish Type ,Access Control, Published Link etc. I have written C# code to iterate this list and trying to change Access control status, if it meet certain condition. In this scenario I cannot able to get access control of sheet. I can able to get sheet name ,row , column . – jeeva sr Jun 30 '22 at 13:03
-
I'm going to provide an answer below, but in the future please try to follow best practices for [how to ask a good question](https://www.apinewbies.com/stack-overflow-101#ask-question) here on Stack Overflow. Specifically, your question should provide enough information (including code) to clearly show what is you're doing and where/how you're running into trouble. Merely describing your objective in a couple of sentences and expecting someone to write all the code for you isn't generally a very successful approach when seeking help here on Stack Overflow. – Kim Brandl Jun 30 '22 at 14:23
1 Answers
Depending on the type of object you're updating (Sheet
, Report
, or Dashboard
), the operations you'll use are as follows:
I've included some code examples below (taken nearly verbatim from those you'll find in the docs I've linked to above.)
One additional note: You'll notice that the values written to the Published Items list that you manually export from Smartsheet differ from the values used by the API. For example, the Access Control
column of exported data contains values like Organization
and Public
-- where as the corresponding values used by the API are ORG
and ALL
.
Example #1: SHEET --> Set ReadOnlyFullAccessibleBy to ALL, ReadWriteAccessibleBy to ORG
SheetPublish sheetPublish = new SheetPublish();
sheetPublish.ReadOnlyLiteEnabled = false;
sheetPublish.ReadOnlyFullEnabled = true;
sheetPublish.ReadOnlyFullAccessibleBy = "ALL";
sheetPublish.ReadWriteEnabled = true;
sheetPublish.ReadWriteAccessibleBy = "ORG";
sheetPublish.IcalEnabled = false;
smartsheet.SheetResources.UpdatePublishStatus(
4583614634583940, // sheetId
sheetPublish
);
Example #2: Report --> Set ReadOnlyFullAccessibleBy to ORG
ReportPublish reportPublish = new ReportPublish();
reportPublish.ReadOnlyFullEnabled = true;
reportPublish.ReadOnlyFullAccessibleBy = "ORG";
smartsheet.ReportResources.UpdatePublishStatus(
1653087851556740, // reportId
reportPublish
);
Example #3: Dashboard (Sight) --> Set ReadOnlyFullAccessibleBy to ALL
SightPublish publish = new SightPublish();
publish.ReadOnlyFullEnabled = true;
publish.ReadOnlyFullAccessibleBy = "ALL";
smartsheet.SightResources.SetPublishStatus(
5363568917931908, // sightId
publish
);

- 13,125
- 2
- 16
- 21