Sep 24 2021
04:08 AM
- last edited on
Apr 01 2022
09:30 AM
by
TechCommunityAP
Sep 24 2021
04:08 AM
- last edited on
Apr 01 2022
09:30 AM
by
TechCommunityAP
Have documented this at three places.
https://github.com/microsoftgraph/microsoft-graph-docs/issues/14359
https://docs.microsoft.com/en-us/graph/api/sitepage-create?view=graph-rest-beta&tabs=http
I am sending below payload with create page endpoint . While page gets created , i get attached error.
{ "name": "LinPage1.aspx", "title": "EriDefault", "publishingState": { "level": "checkout", "versionId": "0.1" }, "webParts": [ { "type": "c70391ea-0b10-4ee9-b2b4-006d3fcad0cd", "data": { "title": "Quick links", "description": "Quick links", "dataVersion": "2.0", "properties": { "items": [ { "sourceItem": { "progId": "", "url": "https://www.google.com", "itemType": 2, "fileExtension": "" }, "thumbnailType": 3, "title": "Google", "id": 2 }, { "sourceItem": { "progId": "", "url": "https://www.youtube.com", "itemType": 2, "fileExtension": "" }, "thumbnailType": 3, "title": "Youtube", "id": 1 } ], "isMigrated": true, "layoutId": "CompactCard", "layoutComponentId": "706e33c8-af37-4e7b-9d22-6e5694d92a6f", "shouldShowThumbnail": true, "title": "QuickLinks 2", "hideWebPartWhenEmpty": "true" }, "dynamicDataPaths": {}, "dynamicDataValues": {}, "serverProcessedContent": {} } } ] }
This payload is copied from response of Add-PnPWebPart command (Through Fiddler)
When page gets created , it does have quick links webpart however JSON it has is diffrent than the payload submitted above. Items gets nested for some reason and hence comalins with ForEach.
Below is the Webpart Data (Got through MaintiananceMode) which is created from above payload, as you see Items chils is appearing twice, even though original payload has it once. . Any idea if its issue with payload or API itself? I could successfuly create other webpart type. Just quick links has issue
{ "id": "c70391ea-0b10-4ee9-b2b4-006d3fcad0cd", "instanceId": "aad89b1a-1dad-4abc-8006-2b8faceb8ecc", "title": "Quick links", "description": "Quick links", "dataVersion": "2.0", "properties": { "isMigrated": true, "layoutId": "CompactCard", "layoutComponentId": "706e33c8-af37-4e7b-9d22-6e5694d92a6f", "shouldShowThumbnail": true, "title": "QuickLinks 2", "hideWebPartWhenEmpty": "true", "items": { "items": [ { "thumbnailType": 3, "title": "Google", "id": 2, "sourceItem": { "progId": "", "url": "https://www.google.com", "itemType": 2, "fileExtension": "" } }, { "thumbnailType": 3, "title": "Youtube", "id": 1, "sourceItem": { "progId": "", "url": "https://www.youtube.com", "itemType": 2, "fileExtension": "" } } ] } }, "dynamicDataPaths": null, "dynamicDataValues": null, "serverProcessedContent": { "htmlStrings": {}, "searchablePlainTexts": {}, "imageSources": {}, "links": {} } }