depth=1
parameter to include linked items only one level below. This helps you to keep track of what level of the sitemap you’re on when you process the responses from the API.
To get the full hierarchy, use the call above for every item on each level. Save the title, URL, and position in the hierarchy of every item you get. This way you’ll progressively get to the bottom of your website’s hierarchy.
After you get all the items you want in your sitemap, you can start building the sitemap in your app using the data you’ve retrieved.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.example.org/schemas/sitemap/0.9">
<url>
<loc>https://www.mywebsite.org/home</loc>
<lastmod>2020-01-08</lastmod>
<changefreq>monthly</changefreq>
</url>
<url>
<loc>https://www.mywebsite.org/shops</loc>
<lastmod>2020-02-14</lastmod>
<changefreq>weekly</changefreq>
</url>
<url>
<loc>https://www.mywebsite.org/shops/brisbane</loc>
<lastmod>2020-03-07</lastmod>
<changefreq>weekly</changefreq>
</url>
</urlset>
elements=sitemap_items
parameter to only get the content items linked in the Sitemap items element.https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items/landing_page?elements=sitemap_items&depth=1