> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Sample Flows

## Article: Sample Flows

## Article Link: https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/sample-flows.md

## Article Content:

# BWT Site Readiness: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

## Set up a site in Bing Webmaster Tools

A Wix user wants their site added to Bing Webmaster Tools, verified, and submitting its sitemap. Your app clears the readiness blockers one at a time, then submits the sitemap.

> **Prerequisite:** Connect a Microsoft account to the site with the [BWT Connection API](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/connection-v1/introduction.md), and wait until the connection's status is `VALID`.

To set up a site:

1. Call [Get Site Readiness](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/get-site-readiness.md). If `status` is `READY`, the site is connected, added, and verified, so continue from step 4.
1. If `status` is `NOT_READY`, act on the returned `blockingReason`:
    - `NOT_CONNECTED`: the site has no usable Bing connection. It was never connected, the connection was removed, or Bing no longer accepts the stored credentials. Connect a Microsoft account with the [BWT Connection API](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/connection-v1/introduction.md).
    - `SITE_NOT_PUBLISHED`: have the Wix user publish the site before continuing.
    - `DOMAIN_NOT_CONNECTED`: Bing Webmaster Tools setup needs a connected domain. Have the Wix user connect one before continuing.
    - `SITE_NOT_ADDED`: the connection works, but the site isn't in the connected Bing account yet. Call [Add Site](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/add-site.md). If the call fails with `FAILED_PRECONDITION` (`SITE_NOT_INDEXABLE`), have the Wix user allow search-engine indexing first.
    - `SITE_OWNER_NOT_VERIFIED`: the site is in the Bing account, but its ownership isn't verified yet. Call [Verify Site](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/verify-site.md). Verification runs synchronously against Bing, so allow up to a minute. A `FAILED_PRECONDITION` (`MISSING_VERIFICATION`) error means Bing didn't find the tag yet, so retry after a short wait.
    - Any other value: treat the site as not ready, and don't assume a next action. New blocking reasons can be added over time.
1. Call [Get Site Readiness](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/get-site-readiness.md) again after each successful action, and repeat until `status` is `READY`. Read the current `blockingReason` each time instead of reusing an earlier one, because a response reports only the first step that's still blocking.
1. Call [Submit Sitemap](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/submit-sitemap.md). The sitemap, which is generated and hosted by Wix, is submitted to the connected Bing account. Bing processes sitemaps asynchronously, so check the processing state later with [List Sitemaps](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/list-sitemaps.md).

Readiness doesn't track the sitemap, so call Submit Sitemap yourself once the site is `READY`.

## Show the site's sitemaps

Your app has a settings page that shows the sitemaps submitted to Bing for the site and how Bing processed them.

To show the sitemaps:

1. Call [List Sitemaps](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/list-sitemaps.md). Each item has the sitemap's `url`, and the details Bing reports for it: `type`, `status`, `submittedDate`, `lastCrawledDate`, `urlCount`, `fileSize`, and `compressed`. If the call fails with `FAILED_PRECONDITION` (`SITE_PROPERTY_NOT_OWNED`), set the site up first, as described in [Set up a site in Bing Webmaster Tools](#set-up-a-site-in-bing-webmaster-tools).
1. Present each sitemap. Show a field only when it's set: Bing leaves a field unreported, for example before it first reads a sitemap it reports `status` `Pending`, and an unset field means "not reported", not zero.
1. When a sitemap's `type` is `Sitemap Index`, call [Get Sitemap](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/get-sitemap.md) with its `url` to get the sitemaps it lists in `childSitemaps`. A `NOT_FOUND` (`SITEMAP_NOT_FOUND`) error means no sitemap with that URL was submitted for the site.

## Remove the site's Bing verification

A Wix user wants Wix to stop managing their site in Bing Webmaster Tools, for example before handing the site over to someone else.

Clear Verification removes the `msvalidate.01` tag that Wix placed, and also disconnects the site from its Bing account. It doesn't remove the site from Bing Webmaster Tools. To keep the tag and only remove the connection, call [Disconnect](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/connection-v1/disconnect.md) in the BWT Connection API instead.

To remove the verification:

1. Call [Clear Verification](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/clear-verification.md). If the call fails with `UNAVAILABLE` (`BWT_SITE_BUSY` or `META_TAGS_WRITE_CONFLICT`), another operation was changing the site at the same time, so retry.
1. Call [Get Site Readiness](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/get-site-readiness.md) to confirm that `blockingReason` is `NOT_CONNECTED`.