Таким образом, проблема в том, что я не знаю, будет ли правильный идентификатор вновь созданного сайта и могу ли я использовать его сразу после успешного создания сайта. Как я могу отличить правильное поведение?
После создания Коммуникационного сайта используйте запрос к POST /_api/sitepages/communicationsite/create
с телом:
{
{"request", {
{"__metadata", {
{"type", "SP.Publishing.CommunicationSiteCreationRequest"}
}},
{"Url", siteInfo.url},
{"Title", siteInfo.title},
{"SiteDesignId", siteInfo.designId},
{"Classification", ""}
}}
}
ответ возвращает идентификатор вновь созданного сайта.
Но если я хочу получить идентификатор этого сайта из запроса на GET /sites/{hostname}:/{server-relative-path}
Я сталкиваюсь с таким странным поведением (каждый раз, когда id случайно меняется !!!):
Я выполнил упомянутый выше запрос 11 раз сразу после создания нового сайта.
Вот результаты
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
---------------
(here, returned right after creation)
site.sharepoint.com,449a607b-0371-434f-98ee-297e33ed913b,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
(/here)
site.sharepoint.com,69debdca-5186-42c5-82c5-f33a2b6e2a4d,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,69debdca-5186-42c5-82c5-f33a2b6e2a4d,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,69debdca-5186-42c5-82c5-f33a2b6e2a4d,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,69debdca-5186-42c5-82c5-f33a2b6e2a4d,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,69debdca-5186-42c5-82c5-f33a2b6e2a4d,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,69debdca-5186-42c5-82c5-f33a2b6e2a4d,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,69debdca-5186-42c5-82c5-f33a2b6e2a4d,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,69debdca-5186-42c5-82c5-f33a2b6e2a4d,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,69debdca-5186-42c5-82c5-f33a2b6e2a4d,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,69debdca-5186-42c5-82c5-f33a2b6e2a4d,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
---------------
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
---------------
site.sharepoint.com,f06c2397-c882-4501-8c99-e2cd6215f085,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,f06c2397-c882-4501-8c99-e2cd6215f085,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,f06c2397-c882-4501-8c99-e2cd6215f085,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,f06c2397-c882-4501-8c99-e2cd6215f085,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,f06c2397-c882-4501-8c99-e2cd6215f085,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,f06c2397-c882-4501-8c99-e2cd6215f085,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,f06c2397-c882-4501-8c99-e2cd6215f085,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,f06c2397-c882-4501-8c99-e2cd6215f085,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,f06c2397-c882-4501-8c99-e2cd6215f085,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,f06c2397-c882-4501-8c99-e2cd6215f085,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,f06c2397-c882-4501-8c99-e2cd6215f085,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
---------------
site.sharepoint.com,27b87d60-2e83-411a-8a00-aec0c9ab8c00,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,27b87d60-2e83-411a-8a00-aec0c9ab8c00,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,27b87d60-2e83-411a-8a00-aec0c9ab8c00,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
(here)
site.sharepoint.com,e5911839-2009-4539-b80c-2d79585b0f49,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
(/here)
site.sharepoint.com,27b87d60-2e83-411a-8a00-aec0c9ab8c00,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,27b87d60-2e83-411a-8a00-aec0c9ab8c00,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,27b87d60-2e83-411a-8a00-aec0c9ab8c00,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,27b87d60-2e83-411a-8a00-aec0c9ab8c00,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,27b87d60-2e83-411a-8a00-aec0c9ab8c00,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,27b87d60-2e83-411a-8a00-aec0c9ab8c00,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,27b87d60-2e83-411a-8a00-aec0c9ab8c00,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
---------------
site.sharepoint.com,aece5894-5a84-4d51-ab0c-6ac0488e9a66,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,aece5894-5a84-4d51-ab0c-6ac0488e9a66,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
(here)
site.sharepoint.com,27b87d60-2e83-411a-8a00-aec0c9ab8c00,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
(/here)
site.sharepoint.com,aece5894-5a84-4d51-ab0c-6ac0488e9a66,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,aece5894-5a84-4d51-ab0c-6ac0488e9a66,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,aece5894-5a84-4d51-ab0c-6ac0488e9a66,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,aece5894-5a84-4d51-ab0c-6ac0488e9a66,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,aece5894-5a84-4d51-ab0c-6ac0488e9a66,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,aece5894-5a84-4d51-ab0c-6ac0488e9a66,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,aece5894-5a84-4d51-ab0c-6ac0488e9a66,651d4c8e-1715-4f77-adbc-66d6bfe60c3c
site.sharepoint.com,aece5894-5a84-4d51-ab0c-6ac0488e9a66,651d4c8e-1715-4f77-adbc-66d6bfe60c3c