存取權需求

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

圖 1. 存取條件可協助訂閱者存取應用程式或平台上的內容。

確認內容存取權要求

你必須為目錄中的每個內容套件指定存取需求。進行這項作業時,請思考下列問題:

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

    僅限觀看動作:

    • 使用者是否需要向外部服務供應商訂閱方案?
    • 你是否提供分級、多套裝或加購訂閱方案?
  • 僅限觀看動作:使用者是否需要租借或購買內容?

  • 存取條件會隨時間變更嗎?

  • 存取權需求是否取決於裝置位置?

存取限制類型

存取限制分為兩種:

付費牆類型

你可以依付費牆類型限制內容存取權。下表詳細說明不同類型的付費牆:

付費牆類型 範例 類別
無須購買或登入。 Crackle nologinrequired
使用者必須登入,但不需要付費訂閱。 Vudu (AVOD) free
使用者必須訂閱 Google Home Premium,存取權與訂閱方案無關。 Netflix

subscription

使用者必須訂閱 Google Home Premium,存取權取決於訂閱方案。 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"
    }
  },
  ...
}

「收聽動作」的付費牆類型

如要指定「聆聽動作」的內容付費牆類型,請使用offer 物件中的 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 用途

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

  • 範例 1: eligibleRegion 包含國家/地區清單。
  • 範例 2: eligibleRegion,其中包含郵遞區號清單的 GeoShape 物件。
  • 範例 3: eligibleRegion 物件,其中包含轉發站區域 (FSA) 代碼清單。GeoShape
  • 示例 4:具有包含 DMA ID 的 GeoShape 物件。eligibleRegion
  • 範例 5:包含 GeoShape 物件清單的 eligibleRegion。 每個檔案都包含 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,其中包含 GeoShape 物件,內含轉發站區域 (FSA) 代碼清單:


"actionAccessibilityRequirement": {
  "@type": "ActionAccessSpecification",
  "category": "subscription",
  "requiresSubscription": {
    "@type": "MediaSubscription",
    "@id": "http://www.example.com/local_tv_network/subscription",
    "name": "Example Subscription",
    "commonTier": true
  },
  "additionalProperty": {
      "@type": "PropertyValue",
      "name": "DisplaySubscriptionIdentifier",
      "value": "http://www.example.com/local_tv_network/subscription"
  },
  "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
  },
  "additionalProperty": {
      "@type": "PropertyValue",
      "name": "DisplaySubscriptionIdentifier",
      "value": "http://www.example.com/abcd/subscription"
  },
  "eligibleRegion":{
    "@type": "GeoShape",
    "@id": "http://example.com/area3",
    "addressCountry": "US",
    "identifier": [
      {
        "@type": "PropertyValue",
        "propertyID": "DMA_ID",
        "value": "501"
      }
    ]
  }
}

範例 5

eligibleRegion,其中包含 GeoShape 物件的清單。 每個檔案都包含 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
  },
  "additionalProperty": {
      "@type": "PropertyValue",
      "name": "DisplaySubscriptionIdentifier",
      "value": "http://www.example.com/local_tv_network/subscription"
  },
 "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. 我們會從你的 Media Actions 動態消息中,查閱內容的必要授權 ID。
  3. 我們會將使用者 entitlementId 與動態饋給中媒體訂閱物件的identifier 屬性相符。如果至少有一個 entitlementId 相符,我們就會判定使用者可以存取內容。
以傳回使用者的授權 ID。
圖 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
        ...
      },
      "additionalProperty": {
        "@type": "PropertyValue",
        "name": "DisplaySubscriptionIdentifier",
        "value": "http://www.example.com/basic_subscription"
      },
      ...
    }
  },
  ...
}

常見的存取權用途

以下是常見的存取權用途:

  • 免費 (無須登入):無須登入、訂閱或購買即可觀看內容。
  • 免費 (須登入):使用者必須登入才能存取內容,但無須訂閱。
  • 單一方案訂閱: 內容需要訂閱才能觀看。無論訂閱方案為何,所有訂閱者都能存取相同內容,包括電影或集數。
  • 多層級訂閱:內容需要訂閱才能使用。訂閱者可根據訂閱方案觀看不同內容,包括電影或劇集。例如「銀色」與「金色」
  • 外掛程式訂閱:內容需要訂閱才能觀看。訂閱者可以在一般訂閱方案中加購優質內容。
  • 一次性購買:使用者購買內容後,即可無限期存取。
  • 直播電視:訂閱方案提供地方、全國和付費頻道。
  • 第三方訂閱: 使用者必須登入有線電視供應商帳戶才能觀看內容。

免費 (不需登入)

不需登入

無須登入或訂閱即可觀看內容。


{
  "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"
    },
    "additionalProperty": {
      "@type": "PropertyValue",
      "name": "DisplaySubscriptionIdentifier",
      "value": "http://www.example.com/example_package"
    },
    "eligibleRegion": {
      "@type": "Country",
      "name": "US"
    }
  }
}

多層級訂閱方案

在分層訂閱模型中,服務供應商會提供多個訂閱層級,例如金級銀級銅級。訂閱較高層級方案的使用者可以存取所有較低層級的內容。不過,如果使用者訂閱的是較低層級的方案,就無法存取較高層級的內容。

圖 3. 分級訂閱模式及其權利代表。

請參考下列情境:

  • 阿珍訂閱了黃金方案。您的授權端點會傳回下列 entitlementId ID:
    • example.com:bronze
    • example.com:silver
    • example.com:gold
  • John 訂閱了「銅級」方案。授權端點會傳回下列 entitlementId
    • example.com:bronze
  • 媒體動作動態饋給說明下列規定:
    • 電影 A 需要 example.com:bronze
    • 電影 B 需要 example.com:silver

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

  • Jane 和 John 都能存取「電影 A」
  • Jane 可以觀看電影 B,但 John 無法。
{
  "actionAccessibilityRequirement": {
    "@type": "ActionAccessSpecification",
    "category": "subscription",
    "requiresSubscription": {
      "@type": "MediaSubscription",
      "@id": "http://www.example.com/basic_subscription",
      "name": "Bronze",
      "commonTier": true
      ...
    },
    "additionalProperty": {
      "@type": "PropertyValue",
      "name": "DisplaySubscriptionIdentifier",
      "value": "http://www.example.com/basic_subscription"
    },
    ...
  }
}

加購訂閱

在加購內容訂閱模式中,服務供應商允許使用者擴充權益,並在基本訂閱方案中新增頻道。使用者可以視需要新增任意數量的頻道。

圖 4. 加購項目訂閱模式及其權利代表。

請參考下列情境:

  • 小珍除了訂閱「Basic」方案,還訂閱了「PRO」和「Sportz」方案。授權端點會傳回下列 entitlementId ID:
    • example.com:basic
    • example.com:pro
    • example.com:sportz
  • John 只有 Basic 方案。授權端點會傳回下列 entitlementId
    • example.com:basic
  • 媒體動作動態饋給說明下列規定:
    • 電影 A 需要 example.com:basic
    • 電影 B 需要 example.com:pro

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

  • Jane 和 John 都能存取「電影 A」
  • Jane 可以觀看電影 B,但 John 無法。
{
  "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
        }
    ],
      "additionalProperty": {
        "@type": "PropertyValue",
        "name": "DisplaySubscriptionIdentifier",
        "value": "http://www.example.com/package/basic"
      },
    }
  }
}

一次性消費

購買

購買後可無限期觀看。


{
  "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
  • expectAcceptanceOf 中加入 actionAccessibilityRequirement,指出購買價格。

租借

使用者可在購買後一段時間內存取內容。


{
  "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,指出租借價格。

電視直播

在媒體動作動態消息中,你可以根據下列兩項使用者條件,限制存取電視直播頻道活動

  • 使用者的裝置位置

    如要限制電視頻道存取權,請指定使用者可存取該頻道的區域。這項條件通常適用於當地無線電視頻道。

  • 使用者的帳戶狀態

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

    這項條件通常適用於下列用途:

    • 套裝組合:全國頻道通常會納入套裝組合,使用者可選擇要訂閱的套裝組合。
    • 加購內容:部分付費頻道會要求使用者在訂閱時,額外加購其他頻道。
    • 地方體育電視網 (RSN):RSN 通常與使用者的「住家」位置相關聯。即使使用者前往「住家」位置以外的地方,也能在 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"
      }
    },
    "additionalProperty": {
      "@type": "PropertyValue",
      "name": "DisplaySubscriptionIdentifier",
      "value": "http://www.example.com/faq"
     },
    "eligibleRegion": {
      "@type": "Country",
      "name": "US"
    }
  }
}
  • 新增 authenticator,表示訂閱者是由其他服務驗證。舉例來說,HBO GO 需要向有線電視供應商訂閱。

常見層級方案

無論訂閱方案為何,所有訂閱者都能觀看一般層級內容。一般層級適用於所有含有 category 的內容。subscription如要進一步瞭解 category 屬性,請參閱「付費牆類型」一節。

為什麼需要一般層級的套件?

多項 Google 產品會向使用者提供電視節目和電影建議,包括 Google 搜尋、Android TV 和 Google 助理。為讓使用者瞭解費用,Google 必須透過通用層級,瞭解所有訂閱者可觀看的內容。Google 也必須瞭解訂閱者可透過特定訂閱方案觀看哪些內容。

除非支援授權 API,否則 Google 建議使用一般層級的影視內容。Google 可透過 API 瞭解特定使用者可存取哪些非一般層級的影視內容。

何時該建立通用層級套件?

如果服務提供的內容可供所有訂閱者觀看,就必須使用一般級別套裝組合。包括只提供單一套裝組合的服務,以及提供多個套裝組合或加購內容的服務。

如果供應商沒有提供所有訂閱者都能觀看的內容,就不必建立一般層級套裝組合。舉例來說,服務供應商可能會在所有套裝方案中提供互斥內容。

常見層級範例

以下是常見層級的範例。

分級訂閱

在分層訂閱模型中,服務供應商會提供多個訂閱層級,例如金級銀級銅級。訂閱較高方案的使用者可以存取較低方案的所有內容。訂閱較低方案的使用者無法存取較高方案的內容。下圖為套件結構範例。

「黃金」級別包含「白銀」級別的所有內容,而「白銀」級別又包含「青銅」級別的所有內容。
圖 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
    }
  ],

外掛程式

在加購內容訂閱模式中,服務供應商允許使用者擴充權利,並在基本訂閱方案中新增頻道。使用者可以視需要新增任意數量的頻道。下圖為套件結構範例。

每位使用者一開始都會訂閱 Basic 頻道,並可選擇加購 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 的重疊部分標示為「通用層」。
圖 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。詳情請參閱「授權識別碼」。

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:

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

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

與 Google 聯絡

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

動作存取規格屬性

如需參考資訊,請參閱「動作存取權規格屬性」一節。