Skip to content

Commit e330f05

Browse files
bcameron1231VesaJuvonen
authored andcommitted
Documentation Updates (SharePoint#3278)
Adding new GetSiteScriptFromList endpoint. Updating cleaning up a text on the page to replace contoso.microsoft.com to contoso.sharepoint.com
1 parent 490060f commit e330f05

File tree

1 file changed

+55
-1
lines changed

1 file changed

+55
-1
lines changed

docs/declarative-customization/site-design-rest-api.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The following REST commands are available for working with site designs and site
2424

2525
- **CreateSiteScript** – Creates a new site script.
2626
- **GetSiteScripts** – Gets a list of information on existing site scripts.
27+
- **GetSiteScriptFromList** – Creates site script syntax from an existing SharePoint list.
2728
- **GetSiteScriptMetadata** – Gets information about a specific site script.
2829
- **UpdateSiteScript** – Updates a site script with new values.
2930
- **DeleteSiteScript** – Deletes a site script.
@@ -152,6 +153,59 @@ Here is an example of the JSON returned after calling **GetSiteScripts**.
152153
}
153154
```
154155

156+
## GetSiteScriptFromList
157+
158+
Gets the site script syntax for a specific list
159+
160+
### Parameters
161+
162+
|Parameter | Description |
163+
|------------|--------------|
164+
| listUrl | The url of the list to retrieve site script |
165+
166+
167+
### Examples
168+
169+
Here's an example of retrieving a site script JSON object from the Contoso customer list.
170+
171+
```javascript
172+
RestRequest("/_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteScriptFromList", {listUrl: "https://consoso.sharepoint.com/sites/projectgo/Lists/Contoso%20customer%20list"});
173+
```
174+
<br/>
175+
176+
Here is an example of the JSON returned after calling **GetSiteScriptFromList**.
177+
178+
```json
179+
{"@odata.context":"https://constoso.sharepoint.com/sites/projectgo/_api/$metadata#Edm.String","value":"{
180+
"actions": [
181+
{
182+
"verb": "createSPList",
183+
"listName": "Contoso customer list",
184+
"templateType": 100,
185+
"subactions": [
186+
{
187+
"verb": "addSPView",
188+
"name": "All Items",
189+
"viewFields": [
190+
"LinkTitle"
191+
],
192+
"query": "",
193+
"rowLimit": 30,
194+
"isPaged": true,
195+
"makeDefault": true
196+
}
197+
]
198+
},
199+
{
200+
"verb": "addNavLink",
201+
"url": "Lists/Contoso customer list/AllItems.aspx",
202+
"displayName": "Contoso customer list",
203+
"isWebRelative": true
204+
}
205+
]
206+
}"}
207+
```
208+
155209
## GetSiteScriptMetadata
156210

157211
Gets information about a specific site script. It also returns the JSON of the script.
@@ -325,7 +379,7 @@ Applies a site design to an existing site collection.
325379
Here's an example of applying a site design to the ProjectGo site collection.
326380

327381
```javascript
328-
RestRequest("/_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ApplySiteDesign", {siteDesignId: "614f9b28-3e85-4ec9-a961-5971ea086cca", "webUrl":"https://contoso.microsoft.com/sites/projectgo"});
382+
RestRequest("/_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ApplySiteDesign", {siteDesignId: "614f9b28-3e85-4ec9-a961-5971ea086cca", "webUrl":"https://contoso.sharepoint.com/sites/projectgo"});
329383
```
330384

331385
## AddSiteDesignTaskToCurrentWeb

0 commit comments

Comments
 (0)