Skip to content

Instantly share code, notes, and snippets.

View nehemiahj's full-sized avatar

Nehemiah Jeyakumar nehemiahj

View GitHub Profile
@nehemiahj
nehemiahj / XM Cloud Deploy Status and Status Fields.md
Last active August 25, 2023 18:53
XM Cloud Deploy Status and Status Fields
Stages Field Name Comments
Provisioning provisioningStatus Responsible for creating hosting infrastructure
Build buildStatus Responsible for building source code
Deployment deploymentStatus Responsible for deploying built artifacts to hosting infrastructure
Post Actions postActionStatus After deployment tasks
Vercel vercelStatus Not available in Sitecore.DevEx.Extensibility.XMCloud.1.1.30. Present in Deploy API
Overall Status calculatedStatus Overall status of the deployment requset
@nehemiahj
nehemiahj / XM Cloud Deployment Info.json
Created August 25, 2023 18:41
XM Cloud Deployment Info
{
"organizationId": "org_xxxxxxxxxxxxxx",
"projectId": "xxxxxxxxxxxxxxxxxxxxx",
"environmentId": "xxxxxxxxxxxxxxxxxxxxxxx",
"id": "xxxxxxxxxxxxxxxxxxxt",
"startedAt": "2023-08-25T18:34:24.9067021Z",
"completedAt": null,
"provisioningStatus": 2,
"provisioningStartedAt": "2023-08-25T18:34:25.2341282Z",
"provisioningCompletedAt": "2023-08-25T18:34:25.569189Z",
@nehemiahj
nehemiahj / Delivery and Preview API Playground.md
Last active August 24, 2023 19:30
Delivery and Preview API Playground
Delivery Preview
IDE URL https://edge.sitecorecloud.io/api/graphql/ide https://CM-INSTANCE/sitecore/api/graph/edge/ide/
Content Published and approved content Content from CM Instance
API Key Name sc_apikey sc_apikey
API Key/Token Edge Token generated from Cloud Portal, Deploy API or CLI. Refer here. Item ID of /sitecore/system/Settings/Services/API Keys/xmcloudpreview
Sample API Key STdlODcySTJ5UEpNMkdaUVZsRW5rckwkSjNBQzJpeVljMmQ5NUYyUmtyST53ZXBhbWVtZWFkcmEkYzk5LW5laGVtLWRldik5ZGNh {A477ABFB-E279-4CDF-9D3D-F96124F846D6}
How to pass HTTP Headers (Recommended) HTTP Headers (Recommended)
@nehemiahj
nehemiahj / Edge API Key creation without proper scope.txt
Created August 23, 2023 17:46
Edge API Key creation without proper scope
POST https://edge.sitecorecloud.io/api/apikey/v1: {
"Request Headers": {
"content-type": "application/json",
"authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InpnbnhyQk9IaXJ0WXp4dnl1WVhNZyJ9.eyJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvb3JnX2lkIjoib3JnX2FSUEtyZzR6OFFQYk9pNVoiLCJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvb3JnX25hbWUiOiJlcGFtLWVtZWEtdHJhaW5pbmctMiIsImh0dHBzOiL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvdGVuYW50X25hbWUiOiJlcGFtZW1lYXRyYTRjOTUtbmVoZW0tZGV2LThkY2EiLCJpc3MiOiJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby8iLXAdXRSMinmTQF3UB2pCBWfrfxK8mHvO9vU3PeQ7PgO35mPtE55ovsvPSJ9jmb3-7HwhWZTQzg0Zp8I51a28XrEs9fMSGWSZ3Tkw",
"accept": "*/*",
"host": "edge.sitecorecloud.io"
},
"Request Body": "{
"CreatedBy": "Nehem",
"Label": "WebPortal",
@nehemiahj
nehemiahj / Create Edge API Key using Deploy API.txt
Last active August 23, 2023 17:42
Create Edge API Key using Deploy API
GET https://xmclouddeploy-api.sitecorecloud.io/api/environments/v1/ULMG5dXEB0vwSyY/obtain-edge-token: {
"Request Headers": {
"content-type": "application/json",
"authorization": "Bearer eyJhbGciOiJSUzI1Ni6IkpXVCIsImtpZCI6InpnbnhyQk9IaXJ0WXp4dnl1WVhNZyJ9.eyJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvdGVuYW50L2NkcF9jbGllbnRfa2V5IjoiMTFhMjhhNzMyNTQ1MzgyMmE1NjNjMmNkZGMxMjZjMWIiLCJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvb3JnX2lkIjoib3JnX2FSUEtyZzR6OFFQYk9pNVoiLCJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvb3JnX25hbWUiOiJlcGFtLWVtZWEtdHJhaW5pbmctMiIsImh0dHBzOi8vYXV0aC5zaXRlY29yZWNsb3VkLmlvL2NsYWltcy9vcmdfZGlzcGxheV9uYW1lIjoiRVBBTSBFTUVBIFRyYWluaW5nIDIiLCJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvb3JnX2FjY291bnRfaWQiOiIwMDExTjAwMDAxVXRVWGpRQU4iLCJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvb3JnX3R5cGUiOiJ1bnNwZWNpZmllZCIsImh0dHBzOi8vYXV0aC5zaXRlY29yZWNsb3VkLmlvL2NsYWltcy9jbGllbnRfbmFtZSI6InRlc3QiLCJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvdGVuYW50X2lkIjoiODU4NzRlZmMt
@nehemiahj
nehemiahj / CreateEdgeAPIKeyusinggeneratedaccess_token.txt
Last active August 23, 2023 17:42
Create Edge API Key using generated access_token
POST https://edge.sitecorecloud.io/api/apikey/v1: {
"Request Headers": {
"content-type": "application/json",
"authorization": "Bearer eyJhbGciOiJIkpCI6InpnbnhyQk9IaXJ0WXp4dnl1WVhNZyJ9.eyJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvb3JnX2lkIjoib3JnX2FSUEtyZzR6OFFQYk9pNVoiLCJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvb3JnX25hbWUiOiJlcGFtLWVtZWEtdHJhaW5pbmctMiIsImh0dHBzOi8vYXV0aC5zaXRlY29yZWNsb3VkLmlvL2NsYWltcy9vcmdfZGlzcGxheV9uYW1lIjoiRVBBTSBFTUVBIFRyYWluaW5nIDIiLCJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvb3JnX2FjY291bnRfaWQiOiIwMDExTjAwMDAxVXRVWGpRQU4iLCJodHRwczovL2F1dGguc2l0ZWNvcmVjbG91ZC5pby9jbGFpbXMvb3JnX3R5cGUiOiJ1bnNwZWNpZmllZCIsImh0dHBzOi8vYXV0aC5zaXRlY29yZWNsb3VkLmlvL2NsYWltcy9jbGllbnRfbmFtZSI6IlNpdGUxIiwiaHR0cHM6Ly9hdXRoLnNpdGVjb3JlY2xvdWQuaW8vY2xhaW1zL3RlbmFudF9pZCI6IjZjNGY4ZmM3LTY0NmItNGY5NS03ZDI1LTA4ZGI5MjYxYWY1OCIsImh0dHBzOi8vYXV0aC5zaXRlY29yZWNsb3VkLmlvL2NsYWltcy90ZW5hbnRfbmFtZSI6ImVwYW1lbWVhdHJhMzJmMC14bWNsb3VkbmVoZW0tZGV2LTJkZmUiLCJpc3MiOiJodHRwczovL2F1dGguc2l0ZWNvcm
@nehemiahj
nehemiahj / requestJWTforExperienceEdgeusingClientIDAndSecret.txt
Last active August 23, 2023 17:43
Request JWT for Experience Edge using Client ID and Secret
POST https://auth.sitecorecloud.io/oauth/token: {
"Request Headers": {
"content-type": "application/x-www-form-urlencoded",
},
"Request Body": {
"grant_type": "client_credentials",
"client_id": "b6x9l84G318HP2jaU29iUJF",
"client_secret": "Po825LsehZKmXXy5Mh_tibkBG4TIlgvE8X7Ti",
"audience": "https://api.sitecorecloud.io"
},
@nehemiahj
nehemiahj / findAndRemoveOrphanedRenderings.ps1
Created August 15, 2023 20:39
Find and remove Orphaned Renderings
function Clean-Renderings {
param(
$item,
$isFinalLayout
)
$defaultLayout = Get-LayoutDevice "Default"
$layout = $null
$pageRenderings = $null
@nehemiahj
nehemiahj / applyRandomImages.ps1
Last active August 15, 2023 20:12
Apply Random Images to a List of Pages using Sitecore PowerShell
#Get all the Article Pages
$pages = Get-ChildItem -Path "master:/sitecore/content/site1/articles" -Recurse | Where-Object { $_.TemplateName -eq "Article Page" }
#Get all the uploaded random images
$images = Get-ChildItem -Path "master:/sitecore/media library/Project/Site1/Articles" -Recurse
foreach($item in $pages) {
#Get random images
$media = Get-Random -InputObject $images
$valstr = -join('<image mediaid="', $media.ID.ToString() , '" />')
@nehemiahj
nehemiahj / removeOriginator.ps1
Last active August 15, 2023 20:20
Remove Originator Field Value using Exported CSV
#Setup folder location to upload the CSV temporarily.
$dataFolder = [Sitecore.Configuration.Settings]::DataFolder
$tempFolder = $dataFolder + "\temp\upload"
$filePath = Receive-File -Path $tempFolder -overwrite
if($filePath -eq "cancel") {
exit
}
#Import the CSV with data