APIs & Integrations

rchee
Member

Site Map Endpoint not getting the same values as UI.

SOLVE

I'm trying to get which pages (site pages, landing page and blog posts) are in the site map, just like it is in the UI https://app.hubspot.com/settings/4*****7/marketing/domains/sitemaps/www.***.***, throught the site-maps api "/content/api/v2/site-maps".  The api returns the site maps and there the fields "blog_posts", "site_page" and "landing_page" are empty.

Shouldn't these fields have the Id of the pages? All i have is Ids in "video_metas" and "image_metas".

 

 

{
    "blog_posts": [],
    "content_options": {},
    "created": 1541171167832,
    "created_by_id": 811527,
    "deleted_at": 0,
    "domain": "www.****.***",
    "has_user_changes": false,
    "id": 6442679814,
    "image_metas": {
        "6219818671": [
           ...
        ],
        ...
    },
    "initiated_at": 1541171167832,
    "knowledge_articles": [],
    "landing_pages": [],
    "name": "default",
    "portal_id": 4*****7,
    "site_pages": [],
    "updated": 1574250280193,
    "updated_by_id": 100,
    "video_metas": {
        "6910796359": [
           ...
        ],
        ...
    }
}

 

 

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Site Map Endpoint not getting the same values as UI.

SOLVE

Hi, @rchee.

 

The team confirmed that the CMS Site Maps API currently only returns pages excluded from site maps.

 

Since you have not excluded any pages, the site-pages, landing-pages, and blog-posts arrays appear empty.

 

We recognize that this is counterintutive, so we will be addressing the issue in upcoming API releases. Apologies for the confusion.

 

In the meantime, we recommend using the following request to the CMS Page Publishing API to see the pages which also appear on your sitemap:

https://api.hubapi.com/content/api/v2/pages?state__in=PUBLISHED_AB&state__in=PUBLISHED&state__in=PUBLISHED_OR_SCHEDULED

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
4 Replies 4
sharonlicari
Community Manager
Community Manager

Site Map Endpoint not getting the same values as UI.

SOLVE

Hey @rchee 

 

I apologize for the delay in getting back to you. I am wondering if you were able to resolve this or if you still need assistance on this matter? 

 

Thank you

Sharon


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes
rchee
Member

Site Map Endpoint not getting the same values as UI.

SOLVE

Thank you @sharonlicari for the late reply. I wasnt able to resolve the issue. As the json i posted before shows, the fields blog_posts, landing_pages and site_pages are empty arrays. Shouldn't it have the pages i have in the site map in it?

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Site Map Endpoint not getting the same values as UI.

SOLVE

Hi, @rchee.

 

Happy to help here. I'd like to try and replicate this behavior, but your email doesn't appear associated with a HubSpot account.

Could you share the full request URL with me via DM? Please obscure all but the first five characters of your hapikey.

Isaac Takushi

Associate Certification Manager
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Site Map Endpoint not getting the same values as UI.

SOLVE

Hi, @rchee.

 

The team confirmed that the CMS Site Maps API currently only returns pages excluded from site maps.

 

Since you have not excluded any pages, the site-pages, landing-pages, and blog-posts arrays appear empty.

 

We recognize that this is counterintutive, so we will be addressing the issue in upcoming API releases. Apologies for the confusion.

 

In the meantime, we recommend using the following request to the CMS Page Publishing API to see the pages which also appear on your sitemap:

https://api.hubapi.com/content/api/v2/pages?state__in=PUBLISHED_AB&state__in=PUBLISHED&state__in=PUBLISHED_OR_SCHEDULED

Isaac Takushi

Associate Certification Manager
0 Upvotes