存取權需求

使用者偏好會觀看或聆聽已可存取的內容,例如現有的訂閱內容。如果 Google 知道使用者可在應用程式或平台上存取哪些內容,就能建構更優質的搜尋結果或回應,將使用者導向該內容。

圖 1. 存取權規定可協助訂閱者存取您應用程式或平台上的內容。

確認內容存取權需求

您必須決定目錄中每個內容套件的存取權需求。建議您思考以下問題:

  • 使用者必須登入應用程式或平台才能存取內容嗎?
  • 使用者是否需要訂閱?

    僅限觀看動作:

    • 使用者是否需要來自外部服務供應商的訂閱?
    • 您是否提供分級、多套件或外掛程式訂閱?
  • 僅供觀看動作:使用者是否需要租借或購買該內容?

  • 存取權需求會隨時間變更嗎?

  • 存取權需求是否因裝置位置而異?

存取權限制類型

存取權限制可分為兩種類型:

付費牆類型

您可以透過付費牆類型限制內容存取權。下表詳細說明各種付費牆類型:

付費牆類型 範例 類別
使用者不必購買或登入, 碎裂 nologinrequired
使用者必須登入,但不需要付費訂閱。 Vudu (AVOD) free
使用者必須擁有有效的訂閱。存取權與訂閱層級無關。 Netflix

subscription

使用者必須擁有有效的訂閱。存取權視訂閱層級而定。 Hulu (外掛程式)

subscription

觀眾可在購買後一段時間內存取該內容。 Vudu rental
內容可在購買後無限期保留。 Vudu purchase
可觀看有線電視內容。 HBO GO externalSubscription

手錶動作的付費牆類型

如要為手錶動作指定內容付費牆類型,請使用動作存取權規格中的 category 屬性:

"potentialAction": {
  "@type":"WatchAction",
  "target": { … },
  "actionAccessibilityRequirement": {
    "@type": "ActionAccessSpecification",
    "category": "subscription",
    "availabilityStarts": "2018-06-01T10:35:29Z",
    "availabilityEnds": "2019-05-31T10:35:29Z",
    "eligibleRegion": {
      "@type": "Country",
      "name": "US"
    }
  },
  ...
}

監聽動作的付費牆類型

如要為「監聽事件」指定內容付費牆類型,請使用優惠物件中的 category 屬性:

"potentialAction": {
  "@type":"ListenAction",
  "target": { … },
  "expectsAcceptanceOf":{
    "@type":"Offer",
    "category":"subscription",
    "availabilityStarts": "2018-06-01T10:35:29Z",
    "availabilityEnds": "2019-05-31T10:35:29Z",
    "eligibleRegion": {
      "@type":"Country",
      "name":"US"
    }
  },
  ...
}

地理位置

您必須指定播放內容所在的地理區域。請使用以下一項或兩項屬性:

如果裝置位置位於 eligibleRegion 中指定的任何地區,且不在 ineligibleRegion 指定的任何區域中,使用者可以存取內容。

eligibleRegionineligibleRegion 屬性支援下列的值:

如果內容遍布全球,請針對 eligibleRegion 使用下列特殊值:

"eligibleRegion": "EARTH",

符合資格區域的用途

以下是 eligibleRegion 屬性的用途範例:

  • 範例 1:eligibleRegion 以及國家/地區清單。
  • 範例 2:eligibleRegion,其中包含包含郵遞區號清單的 GeoShape 物件。
  • 範例 3:eligibleRegion,其中包含包含轉送排序區域 (FSA) 代碼的 GeoShape 物件。
  • 範例 4:eligibleRegion,其中包含包含 DMA ID 的 GeoShape 物件。
  • 範例 5:eligibleRegion,包含 GeoShape 物件清單。 每個都包含一個 DMA ID。
  • 範例 6:ineligibleRegion 含有已封鎖的郵遞區號。

範例 1

eligibleRegion 國家/地區清單:


"actionAccessibilityRequirement": {
  "@type": "ActionAccessSpecification",
  "category": "subscription",
  "requiresSubscription": {
    "@type": "MediaSubscription",
    "@id": "http://www.example.com/north_america_network/subscription",
    "name": "Example Subscription",
    "commonTier": true
  },
  "eligibleRegion": [
    {
      "@type": "Country",
      "name": "US"
    },
    {
      "@type": "Country",
      "name": "CA"
    }
  ]
}

範例 2

eligibleRegion 包含包含郵遞區號清單的 GeoShape 物件:


"actionAccessibilityRequirement": {
  "@type": "ActionAccessSpecification",
  "category": "subscription",
  "requiresSubscription": {
    "@type": "MediaSubscription",
    "@id": "http://www.example.com/local_tv_network/subscription",
    "name": "Example Subscription",
    "commonTier": true
  },
  "eligibleRegion": {
    "@type": "GeoShape",
    "@id": "http://example.com/area1",
    "addressCountry": "US",
    "postalCode": [
      "94118",
      "94119"
    ]
  }
}

範例 3

eligibleRegion 包含含有轉送排序區域 (FSA) 代碼的 GeoShape 物件:


"actionAccessibilityRequirement": {
  "@type": "ActionAccessSpecification",
  "category": "subscription",
  "requiresSubscription": {
    "@type": "MediaSubscription",
    "@id": "http://www.example.com/local_tv_network/subscription",
    "name": "Example Subscription",
    "commonTier": true
  },
  "eligibleRegion":{
    "@type": "GeoShape",
    "@id": "http://example.com/area2",
    "addressCountry": "CA",
    "postalCode": [
      "1A1",
      "K1A"
    ]
  }
}

示例 4

eligibleRegion 包含包含 DMA ID 的 GeoShape 物件:


"actionAccessibilityRequirement": {
  "@type": "ActionAccessSpecification",
  "category": "subscription",
  "requiresSubscription": {
    "@type": "MediaSubscription",
    "@id": "http://www.example.com/abcd/subscription",
    "name": "Example Subscription",
    "commonTier": true
  },
  "eligibleRegion":{
    "@type": "GeoShape",
    "@id": "http://example.com/area3",
    "addressCountry": "US",
    "identifier": [
      {
        "@type": "PropertyValue",
        "propertyID": "DMA_ID",
        "value": "501"
      }
    ]
  }
}

範例 5

eligibleRegion 清單,其中包含 GeoShape 物件清單。 每個 DMA 都包含 DMA ID:


"actionAccessibilityRequirement" : {
   "@type" : "ActionAccessSpecification",
   "eligibleRegion" : [
      {
         "@id" : "http://example.com/dma/601",
         "@type" : "GeoShape",
         "addressCountry" : "US",
         "identifier" : {
            "@type" : "PropertyValue",
            "propertyID" : "DMA_ID",
            "value" : "601"
         }
      },
      {
         "@id" : "http://example.com/dma/602",
         "@type" : "GeoShape",
         "addressCountry" : "US",
         "identifier" : {
            "@type" : "PropertyValue",
            "propertyID" : "DMA_ID",
            "value" : "602"
         }
      }
   ]
}

範例 6

ineligibleRegion 含有已封鎖的郵遞區號:


"actionAccessibilityRequirement": {
  "@type": "ActionAccessSpecification",
  "category": "subscription",
  "requiresSubscription": {
    "@type": "MediaSubscription",
    "@id": "http://www.example.com/local_tv_network/subscription",
    "name": "Example Subscription",
    "commonTier": true
  },
 "eligibleRegion":   {
      "@type": "Country",
      "name": "US"
    },
  "ineligibleRegion": {
    "@type": "GeoShape",
    "@id": "http://example.com/area1",
    "addressCountry": "US",
    "postalCode": [
      "94118",
      "94119"
    ]
  }
}

授權 ID

授權 ID entitlementId 是一個字串,代表存取媒體目錄中一組內容的存取權。為了判斷使用者是否有權存取您的內容,Google 會採取下列步驟:

  1. 我們會向您的授權端點發出 API 呼叫,以便接收使用者的授權 ID。
  2. 我們會從媒體動作動態饋給查詢內容所需的授權 ID。
  3. 將使用者的 entitlementId 與動態饋給中媒體訂閱項目物件的 identifier 屬性進行比對。只要至少有一個 entitlementId 相符,我們就會判定使用者可以存取內容。
圖 2.一位使用者的授權 ID 與內容所需的授權 ID 相符。

Google 建議您使用下列 entitlementId 語法:

<domain name> + colon (:) + <access level to content>

語法範例:

  • example.com:basic
  • example.com:premium
  • example.com:sports

授權 ID 範例

MediaExampleCompany 的動態饋給指定 Movie XYZ 需要 example.com:basic entitlementId,如下所示:

{
  "@context": ["http://schema.org", {"@language": "en"}],
  "@type": "Movie",
  "@id": "www.example.com/movie_xyz",
  "url": "www.example.com/movie_xyz",
  "name": "Movie XYZ",
  "potentialAction": {
    "@type": "WatchAction",
    "target": [ … ],
    "actionAccessibilityRequirement": {
      "@type": "ActionAccessSpecification",
      "category": "subscription",
      "requiresSubscription": {
        "@type": "MediaSubscription",
        "@id": "http://www.example.com/basic_subscription",
        "name": "Basic subscription",
        "commonTier": true
        ...
      },
      ...
    }
  },
  ...
}

常見存取用途

常見存取方式如下:

  • 免費 (不需登入):使用者不必登入、訂閱或購買,即可觀看這項內容。
  • 免費 (須登入):內容要求使用者登入,但不需要訂閱。
  • 單一層級訂閱:需要訂閱的內容。無論是訂閱項目或劇集,所有訂閱者都能存取相同的內容。
  • 多層級訂閱:此內容需要訂閱。訂閱者可以根據自己的訂閱項目層級存取不同的內容,例如電影或劇集。例如:SilverGold
  • 外掛程式訂閱:這項內容需要訂閱才能使用。訂閱者除了在一般訂閱項目外,還可新增付費內容。
  • 一次性消費:使用者可以購買內容,隨後使用者可無限期存取。
  • 電視直播:訂閱項目提供在地、全國和付費頻道的使用權。
  • 第三方訂閱服務:應用程式要求使用者透過有線電視服務供應商登入。

免費 (不需登入)

不需登入

不需登入或訂閱即可觀看內容。


{
  "actionAccessibilityRequirement": {
    "@type": "ActionAccessSpecification",
    "category": "nologinrequired",
    "availabilityStarts": "2015-01-01T00:00Z",
    "availabilityEnds": "2015-12-31T00:00Z",
    "eligibleRegion": {
      "@type": "Country",
      "name": "US"
    }
  }
}
  • category 設為 nologinrequired
  • 請勿加入 expectAcceptanceOf

免費 (必須登入)

需要登入

內容要求使用者登入,但不需要訂閱。


{
  "actionAccessibilityRequirement": {
    "@type": "ActionAccessSpecification",
    "category": "free",
    "availabilityStarts": "2015-01-01T00:00Z",
    "availabilityEnds": "2015-12-31T00:00Z",
    "eligibleRegion": {
      "@type": "Country",
      "name": "US"
    }
  }
}
  • category 設為 free
  • 請勿加入 expectAcceptanceOf

單一層級訂閱

單一層級的訂閱模型中,服務供應商有一個訂閱層級。無論是訂閱項目或劇集,所有訂閱者都能存取相同的內容。


{
  "actionAccessibilityRequirement": {
    "@type": "ActionAccessSpecification",
    "category": "subscription",
    "availabilityStarts": "2015-01-01T00:00Z",
    "availabilityEnds": "2015-12-31T00:00Z",
    "requiresSubscription": {
        "@type": "MediaSubscription",
        "name": "Example Package",
        "commonTier": true,
        "@id": "http://www.example.com/example_package"
    },
    "eligibleRegion": {
      "@type": "Country",
      "name": "US"
    }
  }
}

多級別訂閱項目

在分級訂閱模式中,服務供應商有多個訂閱層級,例如「黃金」、「白銀」和「銅級」。進階訂閱的使用者可存取所有較低層級的內容。但是,訂閱層級較低的使用者無法存取較高層級內容。

圖 3.分級制訂閱模型和授權代表。

請考量下列情境:

  • Jane 訂閱了 Gold 級。您的授權端點會傳回下列 entitlementId ID:
    • example.com:bronze
    • example.com:silver
    • example.com:gold
  • 大明訂閱銅級級別。您的授權端點會傳回下列 entitlementId
    • example.com:bronze
  • 「媒體動作」動態饋給符合下列規定:
    • 電影 A 需要 example.com:bronze
    • 電影 B 需要 example.com:silver

在這種情境中,Google 會決定為 Jane 和 John 提供的下列存取層級:

  • Jane 和 John 都能存取電影 A
  • 小珍擁有電影 B 的存取權,但大明沒有這項權限。
{
  "actionAccessibilityRequirement": {
    "@type": "ActionAccessSpecification",
    "category": "subscription",
    "requiresSubscription": {
      "@type": "MediaSubscription",
      "@id": "http://www.example.com/basic_subscription",
      "name": "Bronze",
      "commonTier": true
      ...
    },
    ...
  }
}

外掛程式訂閱

外掛程式外掛程式服務可讓使用者擴充授權,將頻道新增至基本訂閱項目。使用者可加入任意數量的頻道。

圖 4. 外掛程式訂閱模式及其授權代表。

請考量下列情境:

  • 除了 Basic 訂閱之外,Jane 也有 PROSportz。您的授權端點會傳回下列 entitlementId ID:
    • example.com:basic
    • example.com:pro
    • example.com:sportz
  • 大明只訂閱基本訂閱,您的授權端點會傳回下列 entitlementId
    • example.com:basic
  • 「媒體動作」動態饋給符合下列規定:
    • 電影 A 需要 example.com:basic
    • 電影 B 需要 example.com:pro

在這種情境中,Google 會決定為 Jane 和 John 提供的下列存取層級:

  • Jane 和 John 都能存取電影 A
  • 小珍擁有電影 B 的存取權,但大明沒有這項權限。
{
  "actionAccessibilityRequirement": {
    "@type": "ActionAccessSpecification",
    "category": "subscription",
    "availabilityStarts": "2015-01-01T00:00Z",
    "availabilityEnds": "2015-12-31T00:00Z",
    "eligibleRegion": {
      "@type": "Country",
      "name": "US"
    "requiresSubscription": [
      {
          "@type": "MediaSubscription",
          "@id": "https://www.example.com/package/basic",
          "name": "Basic",
          "sameAs": "https://www.example.com/package/basic",
          "commonTier": true
        },
        {
          "@type": "MediaSubscription",
          "@id": "https://www.example.com/packages/basic/pro",
          "name": "PRO",
          "sameAs": "https://www.example.com/package/pro",
          "identifier": "example.com:pro",
          "commonTier": false
        },
        {
          "@type": "MediaSubscription",
          "@id": "https://www.example.com/package/sportz",
          "name": "Sportz",
          "sameAs": "https://www.example.com/package/sports",
          "identifier": "example.com:sportz",
          "commonTier": false
        }
    }
  }
}

一次性消費

購買

內容可在購買後無限期保留。


{
  "actionAccessibilityRequirement": {
    "@type": "ActionAccessSpecification",
    "category": "purchase",
    "availabilityStarts": "2015-01-01T00:00Z",
    "availabilityEnds": "2015-12-31T00:00Z",
    "eligibleRegion": {
      "@type": "Country",
      "name": "US"
    },
    "expectsAcceptanceOf": {
      "@type": "Offer",
      "price": 7.99,
      "priceCurrency": "USD",
      "seller": {
        "@type": "Organization",
        "name": "Example",
        "sameAs": "http://www.example.com/"
      }
    }
  }
}
  • category 設為 purchase
  • actionAccessibilityRequirement 中加入 expectAcceptanceOf,來表示購買價格。

租借

觀眾可在購買後一段時間內存取該內容。


{
  "actionAccessibilityRequirement": {
    "@type": "ActionAccessSpecification",
    "category": "rental",
    "availabilityStarts": "2015-01-01T00:00Z",
    "availabilityEnds": "2015-12-31T00:00Z",
    "eligibleRegion": {
      "@type": "Country",
      "name": "US"
    },
    "expectsAcceptanceOf": {
      "@type": "Offer",
      "price": 7.99,
      "priceCurrency": "USD",
      "seller": {
        "@type": "Organization",
        "name": "Example",
        "sameAs": "http://www.example.com/"
      }
    }
  }
}
  • category 設為 rental
  • actionAccessibilityRequirement 中加入 expectAcceptanceOf,來表示租借價格。

電視直播

在 Media Actions 動態饋給中,您可以根據下列兩項使用者條件來限制電視直播頻道活動的存取權:

  • 使用者的裝置位置資訊

    如要限制電視頻道的存取權,請指定使用者可存取該電視的區域。這種情況通常適用於本機廣播電視頻道。

  • 使用者的帳戶狀態

    如果電視頻道的存取權取決於使用者的帳戶層級設定,請使用授權 ID 來表示限制。

    此條件通常適用於以下用途:

    • 套裝組合:頻道通常包含國家/地區頻道,使用者則可自行選擇想訂閱的套裝組合。
    • 外掛程式:某些付費頻道會請使用者自行選擇在訂閱中新增其他頻道。
    • 區域體育網路 (RSN):回應式搜尋廣告通常與使用者的「住家」位置相關聯。使用者即使在自己家之外,也能在零售銷售店員上觀看內容。

第三方訂閱服務

第三方訂閱服務

訂閱者可透過其他服務存取該內容。


{
  "actionAccessibilityRequirement": {
    "@type": "ActionAccessSpecification",
    "category": "externalsubscription"
    "availabilityStarts": "2015-01-01T00:00Z",
    "availabilityEnds": "2015-12-31T00:00Z",
    "requiresSubscription":{
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/faq",
      "name": "Example",
      "sameAs": "https://www.example.com/faq",
      "authenticator": {
        "@type": "Organization",
        "name": "TVE"
      }
    },
    "eligibleRegion": {
      "@type": "Country",
      "name": "US"
    }
  }
}
  • 新增 authenticator,表示有不同的服務會驗證訂閱者。舉例來說,HBO GO 需要訂閱有線電視服務供應商。

常見的級別套件

無論訂閱套件為何,所有訂閱者都能存取通用層級內容。通用層級適用於 categorysubscription 的所有內容。如要進一步瞭解 category 屬性,請參閱「付費牆類型」一節。

為什麼需要常見的級別套件?

多項 Google 產品向使用者提供電視和電影建議,包括 Google 搜尋、Android TV 和 Google 助理。如要設定使用者對費用的期望,Google 必須瞭解使用通用級別的所有訂閱者可以使用哪些內容。Google 必須瞭解有特定訂閱套件的訂閱者可以使用什麼內容。

除非您支援 entitlement API,否則 Google 建議以通用層級提供標題。 這個 API 可讓 Google 瞭解每位使用者都能存取的非通用層級標題。

何時需要建立共用級別套件?

如果您的服務提供適用於所有訂閱者的內容,就必須提供一般級別套件。這包括只提供一個套件的服務,以及提供多個套件或外掛程式的服務。

如果供應商沒有內容可供所有訂閱者使用,就不必建立通用層級套件。例如,在其所有套件中提供互斥內容的服務供應商。

常見級別範例

以下是常見級別的範例。

分級訂閱

在分級訂閱模式中,服務供應商有多個訂閱層級,例如「黃金」、「白銀」和「銅級」層級。擁有更高層級訂閱的使用者可以存取較低層級中的所有內容。較低層級訂閱的使用者無法存取較高層級的內容。下圖為套件結構的範例。

黃金級包含所有白銀級的內容,而後者則包含所有銅級。
圖 5.階層式訂閱套件結構。

在以下程式碼範例中,銅級套件是常見的層級,因為所有使用者都可存取該階層中的所有內容。

"requiresSubscription": [
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/bronze",
      "name": "Bronze",
      "sameAs": "https://www.example.com/package/bronze",
      "commonTier": true
    },
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/silver",
      "name": "Silver",
      "sameAs": "https://www.example.com/package/silver",
      "identifier": "example.com:silver",
      "commonTier": false
    },
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/gold",
      "name": "Gold",
      "sameAs": "https://www.example.com/package/gold",
      "identifier": "example.com:gold",
      "commonTier": false
    }
  ],

外掛程式

在外掛程式訂閱模型中,服務供應商可讓使用者擴充授權,並將基本訂閱項目新增至基本訂閱項目。使用者可以視需要新增多個頻道。下圖為套件結構的範例。

每位使用者從基本管道開始,並且可選擇新增 PRO、Sportz 和 Moviemax 頻道的任意組合。
圖 6. 外掛程式訂閱套件結構。

如果您的版本提供給所有使用者,且不須支付頻道費用,則可以將套件與通用層級套件合併。

在以下程式碼範例中,基本套件是通用級別,因為所有使用者都可存取這個套件中的所有內容。

"requiresSubscription": [
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/basic",
      "name": "Basic",
      "sameAs": "https://www.example.com/package/basic",
      "commonTier": true
    },
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/packages/basic/pro",
      "name": "PRO",
      "sameAs": "https://www.example.com/package/pro",
      "identifier": "example.com:pro",
      "commonTier": false
    },
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/sportz",
      "name": "Sportz",
      "sameAs": "https://www.example.com/package/sports",
      "identifier": "example.com:sportz",
      "commonTier": false
    },
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/moviemax",
      "name": "Moviemax",
      "sameAs": "https://www.example.com/package/moviemax",
      "identifier": "example.com:moviemax",
      "commonTier": false
    }
  ],

內容彼此相交的套件

在套件中含有交集的內容模型中,服務供應商會銷售包含其他套件的部分內容。下圖為套件結構的範例。

套件 1、2 和 3 之間的重疊向量圖標示為「Common Tier」(通用階層)。
圖 7.交集內容的套件結構。

以下程式碼範例提供三個套件,其中部分內容與所有套件相交。在本例子中,必須提供代表通用級別的第四個套件。必須包含這三個套件的所有可用內容。

"requiresSubscription": [
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/1",
      "name": "Package 1",
      "sameAs": "https://www.example.com/package/1",
      "identifier": "example.com:package1",
      "commonTier": false
    },
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/2",
      "name": "Package 2",
      "sameAs": "https://www.example.com/package/2",
      "identifier": "example.com:package2",
      "commonTier": false
    },
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/3",
      "name": "Package 3",
      "sameAs": "https://www.example.com/package/3",
      "identifier": "example.com:package3",
      "commonTier": false
    },
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/common",
      "name": "Common Tier Package",
      "sameAs": "https://www.example.com/package/common",
      "commonTier": true
    }
  ],

不含交集內容的套件

在所有內容內容未相牴觸的內容服務供應商中,服務供應商會銷售不包含其他套件內容的套件。下圖為套件結構的範例。

套件 1、2 和 3 彼此分離,
圖 8.沒有交集內容的套件結構。

在下列範例中,供應器提供三個套件,其內容與所有套件相交。不需要常見的級別套件。

"requiresSubscription": [
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/1",
      "name": "Package 1",
      "sameAs": "https://www.example.com/package/1",
      "identifier": "example.com:package1",
      "commonTier": false
    },
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/2",
      "name": "Package 2",
      "sameAs": "https://www.example.com/package/2",
      "identifier": "example.com:package2",
      "commonTier": false
    },
    {
      "@type": "MediaSubscription",
      "@id": "https://www.example.com/package/3",
      "name": "Package 3",
      "sameAs": "https://www.example.com/package/3",
      "identifier": "example.com:package3",
      "commonTier": false
    }
  ],

授權端點

您可以使用本節中的資訊來託管 HTTPS 端點,藉此傳回與使用者相關聯的授權。

先修規定

開始之前,請確認您的服務支援 Google 的 OAuth 2.0 流程

要求

為了接收使用者的授權,Google 會傳送包含使用者 OAuth 權杖的要求。您的端點必須根據該 OAuth 憑證識別使用者。請參閱以下範例:

GET /resource HTTP/1.1
Host: server.example.com
Authorization: Bearer <OAuthToken>

回應

您的端點必須傳回包含以下屬性的回應:

屬性
subscription

必要

這是根回應中的欄位。

subscription.type

必要

這個屬性可能包含下列值:

  • ActiveSubscription:使用者已有供應商的有效訂閱。
  • ActiveTrial:使用者已有供應器的試用期。
  • InactiveSubscription:使用者沒有有效的訂閱項目或有效試用期。
subscription.expiration_date

選用

這個授權的到期日,採 ISO 8601 格式,其中包含時區。詳情請參閱到期日

entitlements

選用

這個根屬性包含使用者保留的 entitlementId 值。

entitlements.entitlement

如果串流目錄的存取權因訂閱類型而異,則為必填屬性。

這個屬性包含 entitlementId。詳情請參閱授權 ID

entitlements.expiration_date

選用

這個訂閱項目的到期日,採 ISO 8601 格式,其中包含時區。詳情請參閱到期日

到期日

端點回應中有兩個屬性,用於處理到期日:subscription.expiration_dateentitlements.expiration_date。您可以擇一加入兩者,但不能同時加入兩者。視訂閱模型而定。

訂閱模式
所有訂閱者的直播目錄都相同。 由於您不需要指定 entitlements 屬性,因此請指定 subscription.expiration_date

串流目錄的存取權會因使用者訂閱項目的詳細資料而異。

如果您的訂閱模型含有多個會過期的級別或外掛程式,請執行下列任一操作:

  • 如果所有 entitlements.entitlement 值都同時到期,請指定 subscription.expiration_date
  • 如果部分 entitlements.entitlement 值在不同時間過期,請指定 entitlements.expiration_date

回應範例

以下是各種訂閱狀態的回應範例:

  • 有效訂閱內容
  • 有到期日的有效訂閱
  • 沒有訂閱項目
  • 可訂閱多個層級或外掛程式的有效訂閱項目

有效訂閱內容

有效訂閱

使用者有一個有效的 example.com 訂閱。在這種情況下,無論訂閱者的訂閱類型為何,所有訂閱者都可以存取整個串流目錄。


{
  "subscription" : {
    "type": "ActiveSubscription",
  }
}

有到期日的有效訂閱

有到期日的有效訂閱

使用者擁有有效的 example.com 訂閱,且訂閱設有到期日。在這種情況下,無論訂閱者的訂閱類型為何,所有訂閱者都可以存取整個串流目錄。


{
  "subscription" : {
    "type": "ActiveSubscription",
    "expiration_date": "2019-11-10T10:00:00Z"
  }
}

沒有訂閱項目

沒有訂閱項目

使用者沒有對 example.com 的訂閱。


{
  "subscription" : {
    "type": "InactiveSubscription"
  }
}

可訂閱多個層級或外掛程式的有效訂閱項目

多個層級或外掛程式的有效訂閱

使用者在訂閱特定日期前訂閱了 example.com:premium


{
  "subscription" : {
    "type": "ActiveSubscription",
  }
  "entitlements": [
    {
      "entitlement": "example.com:premium",
      "expiration": "2019-11-10T10:00:00Z"
    }
  ]
}

頻率限制

Google 每六小時會重新整理使用者的授權資訊。如要順暢清除每秒查詢次數 (QPS),Google 會逐步將查詢平均分配至端點。因此,您可以使用以下公式預估端點的預估平均 QPS:

預期平均每秒查詢次數 = <使用者總數> /21,600 秒 (6 小時 x 60 分鐘 x 60 秒)

如果您支援大量使用者,Google 可以調整 6 小時的間隔時間。 如有需要,請與 Google 聯絡以討論設定內容。

與 Google 聯絡

端點準備就緒後,請與 Google 聯絡,通知端點網址。

動作存取規格屬性

詳情請參閱動作存取規格屬性一節。