共用方式為


建立提示訊息

如果您使用提示要求註冊提取,Microsoft 會將具有下列表單的訊息傳送至您指定的端點,要求您識別自上次提取要求以來的任何路線變更。 您可以決定上線時要求的頻率。

<?xml version="1.0" encoding="UTF-8"?>
<HintRequest id="123-abc" timestamp="2017-10-21T08:45:09Z">
  <LastFetchTime>2017-10-21T08:30:16Z</LastFetchTime>
</HintRequest>

元素 LastFetchTime 會識別您上次傳送 Microsoft 並識別路線變更之最後一個成功回應的 UTC 日期和時間。 如果自該時間起沒有任何變更,您的回應應該會包含空白本文。 如果發生變更,本文會包含 提示 訊息,以識別已變更的路線。 您可以使用下列其中一種方法來識別路線:

確切的路線

您的提示訊息可以使用簽入日期和停留時間來識別個別的行程。 下列範例顯示提示訊息,指定單一旅館的單一行程。

<Hint>
  <Item>
    <Property>789</Property>
    <Stay>
      <CheckInDate>2017-10-20</CheckInDate>
      <LengthOfStay>2</LengthOfStay>
    </Stay>
  </Item>
</Hint>

每個 < 專案 > 都代表個別的路線。 您可以為您想要更新的每個路線指定 < Item > 物件,而每個路線可以指定一或多個屬性。

當 Microsoft 收到上述提示時,它會將下列 查詢 訊息傳送給您:

<Query>
  <Checkin>2017-10-20</Checkin>
  <Nights>2</Nights>
  <PropertyList>
    <Property>789</Property>
  </PropertyList>
</Query>

當您收到查詢訊息時,您的回應應該會包含具有下列 < 結果的交易訊息 > 。

  <Result>
    <Property>789</Property>
    <Checkin>2017-10-20</Checkin>
    <Nights>2</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>

如果上述提示指定兩個屬性,則交易訊息會包含兩 < 個 Result > 元素 (每個屬性) 一個。

簽入日期範圍

您的提示訊息可以識別一系列的路線。 若要指定範圍,請將 專案設定為開始簽入日期,並將 LastDate 設定 FirstDate 為最後一個簽入日期。 下列範例顯示使用日期範圍為單一屬性指定六個簽入日期的提示訊息。

<?xml version="1.0" encoding="UTF-8"?>
<Hint>
  <Item>
    <Property>123</Property>
    <FirstDate>2017-10-20</FirstDate>
    <LastDate>2017-10-25</LastDate>
  </Item>
</Hint>

每個 < 專案 > 都代表單一範圍的簽入日期。 您可以為每個簽入日期範圍指定 < Item > 物件,以識別您想要更新的路線,而且每一個都可指定一或多個屬性。

當 Microsoft 收到上述提示時,它會將下列 查詢 訊息傳送給您。

<Query>
  <FirstDate>2017-10-20</FirstDate>
  <LastDate>2017-10-25</LastDate>
  <Nights>3</Nights>
  <PropertyList>
    <Property>123</Property>
  </PropertyList>
</Query>

當您收到查詢訊息時,您的回應應該包含具有下列 < Result > 物件的交易訊息。

  <Result>
    <Property>789</Property>
    <Checkin>2017-10-20</Checkin>
    <Nights>1</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-20</Checkin>
    <Nights>2</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-20</Checkin>
    <Nights>3</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>

  . . .
  
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-25</Checkin>
    <Nights>1</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-25</Checkin>
    <Nights>2</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-25</Checkin>
    <Nights>3</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>

在此範例中,交易訊息應該包含的結果數目上限為 18 (6 個簽入日期 * 3 個夜間) 。 如果日期範圍的某些行程未變更,您的交易訊息可能包含較少。

展開的簽入日期範圍

展開的簽入日期範圍提示類似于簽入日期範圍提示,不同之處在于它會要求您包含與日期範圍中的路線相交的所有路線。 因此,您的交易訊息應該包含任何簽出日期落在日期範圍內的路線。

<StaysIncludingRange 會 > 將提示識別為展開的簽入日期範圍提示。 若要指定範圍,請將 專案設定為開始簽入日期,並將 LastDate 設定 FirstDate 為最後一個簽入日期。 下列範例顯示使用日期範圍為單一屬性指定六個簽入日期的提示訊息。

<?xml version="1.0" encoding="UTF-8"?>
<Hint>
  <Item>
    <Property>123</Property>
    <StaysIncludingRange>
      <FirstDate>2017-10-20</FirstDate>
      <LastDate>2017-10-25</LastDate>
    </StaysIncludingRange>
  </Item>
</Hint>

每個 < 專案 > 都代表單一路線範圍。 您可以為每個簽入日期範圍指定 < Item > 物件,以識別您想要更新的路線,而且每一個都可指定一或多個屬性。

當 Microsoft 收到上述提示時,它會將下列 查詢 訊息傳送給您。 MaxLengthOfStayQueryControl訊息中的設定會決定 AffectedNights > 的值 < (此範例假設其設定為 3) 。

<Query>
  <FirstDate>2017-10-20</FirstDate>
  <LastDate>2017-10-25</LastDate>
  <AffectedNights>3</AffectedNights>
  <PropertyList>
    <Property>123</Property>
  </PropertyList>
</Query>

當您收到查詢訊息時,您的回應應該包含具有下列 < Result > 物件的交易訊息。 請注意,前幾個物件的簽入日期會落在您提示中的日期之前 FirstDate 。 這是因為路線簽出日期落在提示的日期範圍內。

  <Result>
    <Property>789</Property>
    <Checkin>2017-10-17</Checkin>
    <Nights>3</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-18</Checkin>
    <Nights>2</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-18</Checkin>
    <Nights>3</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-19</Checkin>
    <Nights>1</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-19</Checkin>
    <Nights>2</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-19</Checkin>
    <Nights>3</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-20</Checkin>
    <Nights>1</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>

  . . .
  
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-25</Checkin>
    <Nights>1</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-25</Checkin>
    <Nights>2</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>
  <Result>
    <Property>789</Property>
    <Checkin>2017-10-25</Checkin>
    <Nights>3</Nights>
    <!-- Pricing and other elements that changed -->
  </Result>

批次處理查詢

根據您需要更新的屬性和路線數目,Microsoft 會傳送數個較小的查詢,而不是一個大型查詢。 例如,如果您需要更新 1,000 個屬性的路線,Microsoft 可能會傳送 100 個查詢訊息,每個都有 10 個屬性。