{"info":{"_postman_id":"3645c401-efa7-422c-9b5a-c4b7f6bc0cce","name":"TV 2 Play Partner API docs v. 1.3.4","description":"<html><head></head><body><p>This documentation describes how to interact with TV 2 Play Partner API, also simply called Partner API. The Partner API is a RESTfull web service which acts as a common interface for partners to create and manage TV 2 Play subscriptions.</p>\n<h2 id=\"target-audience\">Target Audience</h2>\n<p>The Partner API documentation is intended for software developers at partners that wishes to use the Partner API and therefore contains descriptions that requires basic knowledge of RESTful API. The documentation can also be useful for other individuals at the partner, that wants to learn about the logic and behavior of the Partner API and partner subscriptions.</p>\n<h2 id=\"partner-api-status\">Partner API Status</h2>\n<p><a href=\"http://partner-api-status.tv2.dk/\">http://partner-api-status.tv2.dk/</a></p>\n<h2 id=\"dictionary\">Dictionary</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Word/phrase</th>\n<th>Definition</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>TV 2 user</td>\n<td>A user account at TV 2</td>\n</tr>\n<tr>\n<td>TV 2 subscription</td>\n<td>A TV 2 Play subscription managed by TV 2.</td>\n</tr>\n<tr>\n<td>Partner subscription</td>\n<td>A TV 2 Play subscription managed by a partner.</td>\n</tr>\n<tr>\n<td>Subscriber</td>\n<td>A user that is subscribed to a subscription</td>\n</tr>\n<tr>\n<td>TV 2 subscriber</td>\n<td>A user that is subscribed to a TV 2 subscription.</td>\n</tr>\n<tr>\n<td>Partner subscriber</td>\n<td>A user that is subscribed to a partner subscription.</td>\n</tr>\n<tr>\n<td>VAS token</td>\n<td>The ID of a subscriber (Value Added Service token).</td>\n</tr>\n<tr>\n<td>Associate ID</td>\n<td>The ID of a ralation between a partner and its associates/sub-partners.</td>\n</tr>\n<tr>\n<td>Agreement ID</td>\n<td>The ID of a agreement with TV 2, spanning one or multiple products.</td>\n</tr>\n<tr>\n<td>Product</td>\n<td>A TV 2 Play product, e.g. <em>Favorit uden reklamer</em> or <em>Basis med reklamer</em>.</td>\n</tr>\n</tbody>\n</table>\n</div><h2 id=\"changelog\">Changelog</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Version</th>\n<th>Change</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>1.3.4</td>\n<td>- Minor text changes.</td>\n</tr>\n<tr>\n<td>1.3.2</td>\n<td>- Corrected URL's for Swagger UI and RapiDoc.</td>\n</tr>\n<tr>\n<td>1.3.1</td>\n<td>- Removed email from subscriber responses.</td>\n</tr>\n<tr>\n<td>1.3.0</td>\n<td>- Applied new TV 2 CVI.  <br>- Updated dictionary.  <br>- Removed link to Redoc from the section <em>Communicating with the API</em>.  <br>- Added a short description of enpoint operations at the section <em>Data model</em>.  <br>- Added the section <em>The partner-subscriber-user relation</em>.  <br>- Added description of test partner key to the section <em>Testing the service</em>.  <br>- Removed \"TV 2 subscription cancellation\" and \"close subscription\" from the section <em>Emails sent to subscribers</em>.  <br>- Removed \"TV 2 subscription cancellation\" from the section <em>Create subscriber.</em>  <br>- Limited subscription status to ACTIVE at the section <em>Fetch subscribers</em>.  <br>- Simplified the section <em>Remove subscriber</em>.  <br>- Removed \"not possible to reactivate warning\" from the section <em>Remove subscriber</em>.</td>\n</tr>\n<tr>\n<td>1.2.5</td>\n<td>- Updated variable naming for updates and to avoid misunderstanding.  <br>- Renaming of type to data type.  <br>- Introducing an additional column stating the type indicating if it's a header/ path/ query or body parameter.</td>\n</tr>\n<tr>\n<td>1.2.4</td>\n<td>- Updated the swagger documentation URL.</td>\n</tr>\n<tr>\n<td>1.2.3</td>\n<td>- Added description of new Malformed Email Address error.</td>\n</tr>\n<tr>\n<td>1.2.2</td>\n<td>- Elaborated on fetching subscribers by subscription status.</td>\n</tr>\n<tr>\n<td>1.2.1</td>\n<td>- Added description of new Unknown Agreement error.</td>\n</tr>\n<tr>\n<td>1.2.0</td>\n<td>- Created the Partner API manual as a Postman documentation.  <br>- Moved agreement ID from subscriber resource object to subscription resource object.  <br>- Made agreement ID mandatory at create subscriber request description.  <br>- Added description of agreement-product relation.  <br>- Changed fetch products request description to reflect the new agreement-product relation.  <br>- Added description of new Product Change Violation error.  <br>- Removed description of cancel subscription and resume subscription.</td>\n</tr>\n</tbody>\n</table>\n</div><h1 id=\"communicating-with-the-api\">Communicating with the API</h1>\n<p>The Partner API documentation contains example requests for all endpoints in multiple programming languages. Moreover, the Partner API is described by Swagger and RapiDoc API documentation which can be reached at:<br><a href=\"https://play-partner.tv2api.dk/swagger/views/swagger-ui/index.html\">https://play-partner.tv2api.dk/swagger/views/swagger-ui/index.html</a> and<br><a href=\"https://play-partner.tv2api.dk/swagger/views/rapidoc/index.html\">https://play-partner.tv2api.dk/swagger/views/rapidoc/index.html</a></p>\n<h2 id=\"data-transmission-and-security\">Data Transmission and Security</h2>\n<p>Because some requests/responses will contain sensitive data, all data is transmitted via HTTPS on the default port (443). The Partner API is hosted on fault tolerant and redundant servers. Because of this, you must connect to the service via the DNS name and not the IP address directly, as the IP address might change.</p>\n<h2 id=\"data-model\">Data model</h2>\n<p>The API is build upon the concept of a subscriber, that is subscribed to subscriptions, and each subscription is assigned a product. In order to manage the concepts <em>subscriber</em>, <em>subscription</em> and <em>product</em>, they are each exposed as a resource object in JSON through the endpoints:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>/subscribers    &lt;-- Create, fetch, update or remove subscribers\n/subscriptions  &lt;-- Update product and/or agreement ID at a subscriber's subscription \n/products       &lt;-- Fetch a list of available products organised by agreement ID\n\n</code></pre><p>The subscriber resource contains one or many subscriptions. A subscription resource contains one product ID. The following shows the entire subscriber resource with its subscription:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">\"subscriber\": {\n    \"vasToken\": \"{{vasToken}}\",\n    \"email\": \"{{email}}\",\n    \"firstName\": \"{{firstName}}\",\n    \"birthYear\": {{birthYear}},\n    \"gender\": \"{{gender}}\",\n    \"associateId\": {{associateId}},\n    \"createPasswordLink\": \"{{createPasswordLink}}\",\n    \"subscriptions\": [\n        {\n            \"status\": \"{{status}}\",\n            \"start\": \"{{start}}\",\n            \"renew\": \"{{renew}}\",\n            \"freePeriod\": {{freePeriod}},\n            \"productId\": {{productId}},\n            \"productName\": \"{{productName}}\",\n            \"agreementId\": \"{{agreementId}}\"\n        }\n    ]\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>JSON property</th>\n<th>Data Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>vasToken</td>\n<td>String</td>\n<td>The unique identifier of the subscriber, which is defined and supplied by the partner.</td>\n</tr>\n<tr>\n<td>email</td>\n<td>String</td>\n<td>The email of the subscriber which the subscriber uses as part of the login credentials at TV 2.</td>\n</tr>\n<tr>\n<td>firstName</td>\n<td>String</td>\n<td>The first name of the subscriber.</td>\n</tr>\n<tr>\n<td>birthYear</td>\n<td>Number</td>\n<td>The birth year of the subscriber. The format is YYYY.</td>\n</tr>\n<tr>\n<td>gender</td>\n<td>String</td>\n<td>The gender of the subscriber, is either F (female), M (male) or U (unknown).</td>\n</tr>\n<tr>\n<td>associateId</td>\n<td>Number</td>\n<td>The associate ID, which is created by the partner and used to link the subscriber to a partner’s associate.</td>\n</tr>\n<tr>\n<td>createPasswordLink</td>\n<td>String</td>\n<td>The link to the subscriber’s create password web page at TV 2. The link is present if the following two criteria are met: (1) an agreement with TV 2 has been made to disable activation emails, (2) a new TV 2 user has been created. If one of the criteria are not met, the link will be absent.</td>\n</tr>\n<tr>\n<td>status</td>\n<td>String</td>\n<td>The status of the subscription. Can be either ACTIVE or EXPIRED</td>\n</tr>\n<tr>\n<td>start</td>\n<td>String</td>\n<td>The date-time for the creation of the subscription. The format is yyyy-MM-dd'T'HH:mm:ssssss'Z'</td>\n</tr>\n<tr>\n<td>renew</td>\n<td>String</td>\n<td>The date-time for next renewal or subscription termination. The format is yyyy-MM-dd'T'HH:mm:ssssss'Z'</td>\n</tr>\n<tr>\n<td>freePeriod</td>\n<td>Number</td>\n<td>The number of days without subscription fee. The free period is at subscription start. Whether free period is given and the lenght of free period is defined in cooperation with TV 2.</td>\n</tr>\n<tr>\n<td>productId</td>\n<td>Number</td>\n<td>The product ID for this subscription.</td>\n</tr>\n<tr>\n<td>productName</td>\n<td>String</td>\n<td>The name of the product.</td>\n</tr>\n<tr>\n<td>agreementId</td>\n<td>String</td>\n<td>The identifier of the agreement. The agreement is typical a pricing model for a specific package solution at a partner. The agreement also contains product rules. Agreement IDs are defined in cooperation with TV 2.</td>\n</tr>\n</tbody>\n</table>\n</div><blockquote>\n<p><em><strong>NOTE:</strong></em> Requests and responses does not contain all of the JSON properties of the respected resource. The expected and necessary properties for the requests and the properties returned in the responses can be seen at the request descriptions. </p>\n</blockquote>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> The endpoint <em>/subscribers</em> can be used to fetch subscriber resources, incl. subscriptions, but can only update the subscriber resource, not the subscription. Use the endpoint <em>/subscriptions</em> to update a subscriber's subscription. </p>\n</blockquote>\n<h2 id=\"the-partner-subscriber-user-relation\">The partner-subscriber-user relation</h2>\n<p>A TV 2 user is a unified single account utillized by the end-user to access TV 2 Play and other systems supplied by TV 2. Logging in requeres an email and a password. Normally the password is set by the end-user at user creation, but if the user is created through the Partner API a <em>create-password-link</em> is sent to the email address. The end-user is free to change the email adress and the password whenever they see fit.</p>\n<p>A subscriber is an abstraction of the TV 2 user. At subscriber creation, an email and a VAS token is supplied by the partner. At creation, the email is used as an identifier of the TV 2 user that should be linked to the subscriber. If no TV 2 user with the email exists, a new TV 2 user with the email will be created. The VAS token is henceforth used as the subscribers identifier; thus the partner has a subscriber identifier that is independent on the dynamic email of the TV 2 user. Learn more at the section <a href=\"#7a0aad34-632f-4986-b81d-901d2729ffe7\">Create subscriber</a>.<br>A subscriber is created with an active subscription. It is the subscription, that grants the TV 2 user access to watch content at TV 2 Play. If the partner wishes to cancel the subscription, the partner must use the remove subscriber endpoint; learn more at the section <a href=\"#620e4f07-aa2f-4447-841a-3ddaa69eea6c\">Remove subscriber</a>.</p>\n<p>A partner can have multiple subscribers, but only one subscriber per TV 2 user and a subscriber has one active subscription, see <em>Figure 1: The partner-subscriber-subscription relation</em>. Thus, it is not possible for a partner to create multiple active subscriptions to one single user. Note that if the partner has cancelled the subscription, by <em>remove subscriber</em>, the subscription is no longer active and the partner is able to create a new active subscription by <em>create subscriber.</em></p>\n<img src=\"https://content.pstmn.io/f908ec1e-2c93-4a2b-a88f-9d861a96ea75/UGFydG5lci1zdWJzY3JpYmVyLXN1YnNjcmlwdGlvbiByZWxhdGlvbiAoMikucG5n\" alt=\"Figure%201:%20The%20partner-subscriber-subscription%20relation\">\n\n<p>Moreover, the partner subscription will exist in parallel with a TV 2 subscription, if any, and exist in parallel with any partner subscriptions from other partners, see <em>Figure 2: Parallel existence of TV 2 subscription and partner subscriptions</em>. Meaning, that subscriptions created by the end-user through Play and subscriptions created by partners cannot affect each other. It also means, that a Partner cannot use the Partner API to fetch/search, update or delete TV 2 subscriptions or subscriptions created by other partners. But, the end-user is able to get an overview of all subscriptions and who supplies them at the TV 2 user administration site called <em>Mit TV 2</em>.</p>\n<img src=\"https://content.pstmn.io/a40bacab-9d31-4751-bbab-ffa5f56eb146/UGFyYWxsZWwgZXhpc3RlbmNlIG9mIFRWIDIgc3Vic2NyaXB0aW9uIGFuZCBwYXJ0bmVyIHN1YnNjcmlwdGlvbnMgKDEpLnBuZw==\" alt=\"Figure%202:%20Parallel%20existence%20of%20TV%202%20subscription%20and%20partner%20subscriptions\">\n\n<h2 id=\"agreement-product-relation\">Agreement-product relation</h2>\n<p>All subscriptions are assigned to an agreement ID and a product ID. Both are mandatory at creation and can not be removed. Agreement ID and product ID are updatable, however. Go to <a href=\"#f3e9dd57-d848-4381-9d27-5c3aea7201f4\">Update subscription</a> to learn more about how to update the agreement ID and product ID.<br>At creation of a subscriber and when updating the agreement ID and/or product ID at the subscription, the agreement ID and product ID has to comply with the agreement-product relation. The agreement-product relation contains two rule sets:</p>\n<ol>\n<li><p>Product availability rules - Each agreement has a list of available products. Get a list of available products by use of <a href=\"#0e95932a-a7ca-4740-86d0-7330cb1ba5b7\">Fetch products</a>.</p>\n</li>\n<li><p>Product upgrade/downgrade rules - When changing a product and keeping the agreement ID unchanged, the resulting product update or downgrade has to comply with the upgrade/downgrade rules that are defined in cooperation with TV 2.</p>\n</li>\n</ol>\n<h2 id=\"emails-sent-to-subscribers\">Emails sent to subscribers</h2>\n<p>When the Partner API executes certain requests, the API will send emails to the end-users. The following is a list of actions and the resulting emails.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Email no.</th>\n<th>Endpoint</th>\n<th>Action</th>\n<th>Mail description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>1</td>\n<td>POST /subscribers</td>\n<td>Create new TV 2 user to create subscriber and subscription</td>\n<td>Login information to new TV 2 user including link to create a password at TV 2 Play</td>\n</tr>\n<tr>\n<td>2</td>\n<td>POST /subscribers</td>\n<td>Utilise existing TV 2 user to create subscriber and subscription</td>\n<td>Login information to existing TV 2 user with instructions to use existing email and password</td>\n</tr>\n<tr>\n<td>3</td>\n<td>PUT /subscribers/{vasToken}</td>\n<td>Change email</td>\n<td>Email changed by partner</td>\n</tr>\n<tr>\n<td>4</td>\n<td>DELETE /subscribers/{vasToken}</td>\n<td>Remove/detach subscriber from the partner and close subscription</td>\n<td>Access to TV 2 Play is closed by partner</td>\n</tr>\n</tbody>\n</table>\n</div><h1 id=\"errors\">Errors</h1>\n<p>This service can return two categories of errors; an error and a validation error. A validation error is returned if the input is invalid, e.g. parameters are missing or parameters contains illegal values. Validation errors are returned with HTTP status code 400 and a response body containing a list of validation errors formatted in JSON. A single validation error response can contain one to many validation errors as shown in the example below.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>HTTP status code: 400\n{\n    \"validationErrors\": [\n        {\n            \"message\": \"Specified value 'newmailtv2.dk' is not a valid email\"\n        },\n        {\n            \"message\": \"vasToken cannot be null\"\n        }\n    ]\n}\n\n</code></pre><p>All other types of errors, that are not validation errors, are returned as an error. An error is returned if, e.g. the VAS token in a create subscriber request is occupied or the product ID is unknown. Errors are returned with a HTTP status code and a response body containing an error code and an error message as shown in the following example.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>HTTP status code: 400\n{\n    \"errorCode\": 5007,\n    \"errorMessage\": \"VAS token already in use. Another subscriber at the partner uses the VAS token.\"\n}\n\n</code></pre><p>The chapter <em>Error codes</em> contains a list of errors inlc. HTTP status codes, error codes and error messages.</p>\n<h2 id=\"error-codes\">Error codes</h2>\n<p>Errors are returned with a HTTP status code and a response body containing an error code and an error message. A client of this service can recognize a distinct error by the error code while the error message supplies a human readable error description. The purpose of the error messages is to inform the writer of the service client and therefore it is not recommended to pass the error massage to the end user.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>HTTP status code</th>\n<th>errorCode</th>\n<th>errorMessage</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400 (Bad Request)</td>\n<td>5007 (VAS Token Occupied)</td>\n<td>VAS token already in use. Another subscriber at the partner uses the VAS token.</td>\n</tr>\n<tr>\n<td>400 (Bad Request)</td>\n<td>5008 (Email Occupied)</td>\n<td>Email already in use. Another subscriber at TV 2 uses the email.</td>\n</tr>\n<tr>\n<td>400 (Bad Request)</td>\n<td>5014 (Malformed Email Address)</td>\n<td>Email address contains a faulty/non-existent domain. Faulty domain: {faultyDomain}. Suggested domain: {suggestedDomain}.</td>\n</tr>\n<tr>\n<td>400 (Bad Request)</td>\n<td>5009 (Product Unavailable)</td>\n<td>Product unavailable. The product is not grantable by the combination of partner and agreement or the product does not exist.</td>\n</tr>\n<tr>\n<td>400 (Bad Request)</td>\n<td>5012 (Product Change Violation)</td>\n<td>Product Change Violation. Product change can not be executed within the agreement.</td>\n</tr>\n<tr>\n<td>400 (Bad Request)</td>\n<td>5013 (Unknown Agreement)</td>\n<td>Unknown agreement. The agreement ID is not registered to the partner.</td>\n</tr>\n<tr>\n<td>401 (Unauthorized)</td>\n<td>N/A</td>\n<td>N/A</td>\n</tr>\n<tr>\n<td>404 (Not Found)</td>\n<td>5005 (Subscriber Not Found)</td>\n<td>Subscriber not found. Could not find a subscriber with the VAS token.</td>\n</tr>\n<tr>\n<td>404 (Not Found)</td>\n<td>5006 (Subscription Not Found)</td>\n<td>Subscription not found. Could not find a subscription with the product ID.</td>\n</tr>\n<tr>\n<td>500 (Internal Server Error)</td>\n<td>1000 (Unknown Error)</td>\n<td>Unknown error.</td>\n</tr>\n<tr>\n<td>502 (Bad Gateway)</td>\n<td>4002 (Gateway error)</td>\n<td>Gateway error.</td>\n</tr>\n</tbody>\n</table>\n</div><h1 id=\"testing-the-service\">Testing the service</h1>\n<p>TV 2 will charge the partner for subscriptions created by the Partner API accoring to the partner agreement. To avoid charges while testing, there are two options:</p>\n<ol>\n<li><p>Test mode<br> The API will use stubs, programmed to return fixed values. Therefore no changes will be made and therefore change operations (create, update and delete) will not be persisted. Test mode is for checking that requests are readable for the Partner API and responses are readable by the partner.</p>\n</li>\n<li><p>Test partner key<br> In addition to a partner key, TV 2 may delever a test partner key. The test partner key gives access to a second account in the production environment at TV 2, called a test account. The test account has the same features as the normal account, but subscriptions are automatically closed after a short amount of days and the partner is not charged for these subscriptions.</p>\n</li>\n</ol>\n<blockquote>\n<p><strong>WARNING</strong>: By using a test partner key, emails are sent as if using a normal partner key. Therefor it is highly recommended <em>not</em> to use emails of actual people; instead use bogus emails like \"<a href=\"https://mailto:test123456@mailinator.com\">test123456@mailinator.com</a>\". </p>\n</blockquote>\n<blockquote>\n<p><strong>NOTE</strong>: To test in <em>test mode</em>, you need a partner key. </p>\n</blockquote>\n<h1 id=\"troubleshooting\">Troubleshooting</h1>\n<p>This chapter explanes the common way of dealing with specific error responses from the Partner API.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>HTTP status code</th>\n<th>errorCode</th>\n<th>Solutions</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400 (Bad Request)</td>\n<td>5007 (VAS Token Occupied)</td>\n<td>Use a VAS token that is not occupied by the partner, or free the VAS token by using the <a href=\"#620e4f07-aa2f-4447-841a-3ddaa69eea6c\">remove subscriber</a> request to remove/detach the subscriber that occupies the VAS token.</td>\n</tr>\n<tr>\n<td>400 (Bad Request)</td>\n<td>5008 (Email Occupied)</td>\n<td>Use a email that is not occupied by a subscriber at TV 2.</td>\n</tr>\n<tr>\n<td>400 (Bad Request)</td>\n<td>5009 (Product Unavailable)</td>\n<td>Check that the product ID is correct and that the agreement ID contains the product ID by use of <a href=\"#b10108aa-d83b-4cbe-8481-fe897acbdb8a\">fetch products</a>.</td>\n</tr>\n<tr>\n<td>400 (Bad Request)</td>\n<td>5012 (Product Change Violation)</td>\n<td>It is not allowed to change from the current product to the targeted product within the agreement.</td>\n</tr>\n<tr>\n<td>400 (Bad Request)</td>\n<td>5013 (Unknown Agreement)</td>\n<td>A non-existing agreement ID has been used. Use an existing agreement ID. A list of all agreement ID's can be retrieve by <a href=\"#b10108aa-d83b-4cbe-8481-fe897acbdb8a\">fetch products</a>.</td>\n</tr>\n<tr>\n<td>401 (Unauthorized)</td>\n<td>N/A</td>\n<td>Check that the bearer token and the format of the bearer token is correct.</td>\n</tr>\n<tr>\n<td>404 (Not Found)</td>\n<td>5005 (Subscriber Not Found)</td>\n<td>Check that the VAS token is correct.</td>\n</tr>\n<tr>\n<td>404 (Not Found)</td>\n<td>5006 (Subscription Not Found)</td>\n<td>Check that the product ID is correct and that the subscriber has a subscription with that product ID.</td>\n</tr>\n<tr>\n<td>500 (Internal Server Error)</td>\n<td>1000 (Unknown Error)</td>\n<td>Contact TV 2 if the error persists.</td>\n</tr>\n<tr>\n<td>502 (Bad Gateway)</td>\n<td>4002 (Gateway error)</td>\n<td>Contact TV 2 if the error persists.</td>\n</tr>\n</tbody>\n</table>\n</div><h1 id=\"faq\">FAQ</h1>\n<p>Q: I get {\"errorCode\":4007,\"errorMessage\":\"Not acceptable media type, please referer to the documentation for accepted media types\"} in my response body. What should I do?<br>A: The error is caused by a missing Accept HTTP header. Add the HTTP header <em>Accept</em> with the value <em>application/json</em>.</p>\n<p>Q: Why can I not find my subscriber in the response from fetch subscribers?<br>A: The subscriber may be filtered out. Change the parameters limit, offset and/or status to include the subscriber in the get subscribers response.</p>\n<p>Q: I get VAS Token Occupied when creating a subscriber. How can I reuse a VAS token that is occupied?<br>A: Use <a href=\"#620e4f07-aa2f-4447-841a-3ddaa69eea6c\">remove subscriber</a> to remove/detach the occupying subscriber from your partner user. By doing so, the VAS token will become unoccupied and can be reused at <a href=\"#7a0aad34-632f-4986-b81d-901d2729ffe7\">create subscriber</a>. Bevare that remove subscriber closes the subscription of the subscriber and that you will no longer be able to fetch or update the subscriber or the subscription.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Communicating with the API","slug":"communicating-with-the-api"},{"content":"Errors","slug":"errors"},{"content":"Testing the service","slug":"testing-the-service"},{"content":"Troubleshooting","slug":"troubleshooting"},{"content":"FAQ","slug":"faq"}],"owner":"6156495","collectionId":"3645c401-efa7-422c-9b5a-c4b7f6bc0cce","publishedId":"2sB3BDKqvc","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-08-08T06:43:48.000Z"},"item":[{"name":"Create subscriber","id":"a4b895ae-c776-485b-8822-ab7c0bd55ca7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n    \"vasToken\": \"{{vasToken}}\",\r\n    \"email\": \"{{email}}\",\r\n    \"firstName\": \"{{firstName}}\",\r\n    \"birthYear\": \"{{birthYear}}\",\r\n    \"gender\": \"{{gender}}\",\r\n    \"associateId\": {{associateId}},\r\n    \"subscription\": {\r\n        \"productId\": {{productId}},\r\n        \"agreementId\": \"{{agreementId}}\"\r\n    }\r\n}"},"url":"https://play-partner.tv2api.dk/subscribers?testMode={{testMode}}","description":"<p>This request creates a subscriber with a new subscription with a given product. The create subscriber request requires, as minimum, a VAS token, an email, a product ID and an agreement ID. Go to the parameter description to learn more about these parameters.<br />At creation, the subscriber is linked to a TV 2 user, which is identified by the email. Shortly after a subscriber has been created, an activation email will be send to the user's email adress notifying, that the user has been granted access to TV 2 Play by the partner.</p>\n<p>The result of <em>create subscriber</em> and which activation email is send, is depending on whether a user with the given email already exists at TV 2. <em>Figure 1: Simplified illustration of create subscriber behaviour</em> shows the different outcomes based on the condition.<br />In short, if the TV 2 user does not exist, a new TV 2 user will be created and related to the partner as a new partner subscriber and be given a new partner subscription. If the TV 2 user already exists, the existing TV 2 user will be related to the partner as a new partner subscriber and be given a new partner subscription.</p>\n<img src=\"https://content.pstmn.io/42f5e6cf-9bdd-48a4-adb6-8350e3011051/Q3JlYXRlIFN1YnNjcmliZXIucG5n\" alt=\"Figure%201:%20Simplified%20illustration%20of%20create%20subscriber%20behaviour\" />\n\n<p>The activation emails from figure 1 is listed below.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Activation email no.</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>1</td>\n<td>Login information to new TV 2 user including link to create a password at TV 2 Play.</td>\n</tr>\n<tr>\n<td>2</td>\n<td>Login information to existing TV 2 user with instructions to use existing email and password.</td>\n</tr>\n</tbody>\n</table>\n</div><p>If agreed upon with TV 2, activation emails will not be send. In such case, an extra JSON-property named <em>createPasswordLink</em> will be present at the response body, but only if the request creates a new TV 2 user (alternative to activation email 1). If the request does not create a new TV 2 user, but instead adds a subscription to an existing TV 2 user, the createPasswordLink property will be absent. The link directs to the TV 2 user's create-password-page, where the end-user can set the password for the user's TV 2 account. The link will be deativated 7 days after subscriber creation.</p>\n<blockquote>\n<p><strong>WARNING</strong>: A subscriber occupies the VAS token and email at partner level making it impossible for the partner, whom created the subscriber, to create other subscribers with either the same VAS token or the same email. Use <em>remove subscriber</em> in order to reuse the VAS token and/or email. </p>\n</blockquote>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> The VAS token is a unique identifier at partner level, which means that there can only exist one subscriber with a given VAS token per partner. A VAS token can not be occupied by another partner or used to fetch or update subscriptions of other partners or subscriptions from TV 2. </p>\n</blockquote>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> The email is unique at TV 2, which means that there can only be one TV 2 user with a given email. If multiple subscribers from multiple partners are created with the same email, the subscribers shares the same TV 2 user, thus a TV 2 user may have multiple independent subscriptions; one per partner. Subscriptions work independently from other partners, which means that a partner is not able to fetch or interact with subscriptions from other partners. If a partner fetches a subscriber linked to a TV 2 user, that also has been granted subscriptions created by other partners, only the subscriptions created by the partner is returned. </p>\n</blockquote>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> Create subscriber may result in a Product Unavailable Error, if the agreement ID does not include the product ID. Visit the chapter Agreement-Product relation to learn more. </p>\n</blockquote>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> Create subscriber may result in an Unknown Agreement Error, if a non-existing agreement ID has been used. </p>\n</blockquote>\n<h2 id=\"parameters\">Parameters</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th>Data Type</th>\n<th>M/O</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>partnerKey</td>\n<td>Header</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>A unique partner key handed to the partner by TV 2.</td>\n</tr>\n<tr>\n<td>testMode</td>\n<td>Query</td>\n<td>Boolean</td>\n<td>Optional</td>\n<td>If set to true, it means the service is in test mode and no subscribers or subscriptions will actually be made. Default is false.</td>\n</tr>\n<tr>\n<td>vasToken</td>\n<td>Body</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>The unique identifier of the subscriber, which is defined and supplied by the partner.</td>\n</tr>\n<tr>\n<td>email</td>\n<td>Body</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>The email of the subscriber which the subscriber uses as part of the login credentials at TV 2.</td>\n</tr>\n<tr>\n<td>firstName</td>\n<td>Body</td>\n<td>String</td>\n<td>Optional</td>\n<td>The first name of the subscriber.</td>\n</tr>\n<tr>\n<td>birthYear</td>\n<td>Body</td>\n<td>Number</td>\n<td>Optional</td>\n<td>The birth year of the subscriber. The format is YYYY.</td>\n</tr>\n<tr>\n<td>gender</td>\n<td>Body</td>\n<td>String</td>\n<td>Optional</td>\n<td>The gender of the subscriber, is either F (female), M (male) or U (unknown).</td>\n</tr>\n<tr>\n<td>associateId</td>\n<td>Body</td>\n<td>Number</td>\n<td>Optional</td>\n<td>The associate ID that is created by the partner and used to link the subscriber to a partner’s associate.</td>\n</tr>\n<tr>\n<td>productId</td>\n<td>Body</td>\n<td>Number</td>\n<td>Mandatory</td>\n<td>The product ID of a TV 2 PLAY product. This is the product that will be attached to the subscription. Use <a href=\"#ce57ee47-319e-42da-b42b-dfa1436f5f1a\">fetch products</a> to get a list of valid product IDs.</td>\n</tr>\n<tr>\n<td>agreementId</td>\n<td>Body</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>The identifier of the agreement that the subscriber shall be related to. The agreement is typical a pricing model for a specific package solution at a partner. The agreement also contains product rules. Agreement IDs are defined in cooperation with TV 2.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["subscribers"],"host":["https://play-partner.tv2api.dk"],"query":[{"key":"testMode","value":"{{testMode}}"}],"variable":[]}},"response":[{"id":"88750b83-6557-4dff-ae83-317a856981e8","name":"Create subscriber without activation email","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"vasToken\": \"adsfgsfg-adfadfga\",\r\n    \"email\": \"nancy@tv2.dk\",\r\n    \"firstName\": \"Nancy\",\r\n    \"birthYear\": 1948,\r\n    \"gender\": \"F\",\r\n    \"associateId\": 0,\r\n    \"subscription\": {\r\n        \"productId\": 1250,\r\n        \"agreementId\": \"Package 1\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://play-partner.tv2api.dk/subscribers?testMode={{testMode}}","host":["https://play-partner.tv2api.dk"],"path":["subscribers"],"query":[{"key":"testMode","value":"{{testMode}}"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"subscriber\": {\n        \"vasToken\": \"adsfgsfg-adfadfga\",\n        \"createPasswordLink\": \"https://auth.tv2.dk/lo/reset?ticket=eax6NcEZf4ljGJoa4wrJ28qAF2dBsmrL#\",\n        \"associateId\": 0,\n        \"subscriptions\": [\n            {\n                \"status\": \"ACTIVE\",\n                \"start\": \"2020-09-10T13:58:18.650297Z\",\n                \"renew\": \"2020-10-10T13:58:18.650297Z\",\n                \"freePeriod\": 30,\n                \"productId\": 1250,\n                \"productName\": \"Basis med reklamer\",\n                \"agreementId\": \"Package 1\"\n            }\n        ]\n    },\n    \"testMode\": false\n}"},{"id":"b6ef9fb6-8177-4419-acce-575d83956d96","name":"Create subscriber","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"vasToken\": \"adsfgsfg-adfadfga\",\r\n    \"email\": \"nancy@tv2.dk\",\r\n    \"firstName\": \"Nancy\",\r\n    \"birthYear\": 1948,\r\n    \"gender\": \"F\",\r\n    \"associateId\": 0,\r\n    \"subscription\": {\r\n        \"productId\": 1250,\r\n        \"agreementId\": \"Package 1\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://play-partner.tv2api.dk/subscribers?testMode=false","host":["https://play-partner.tv2api.dk"],"path":["subscribers"],"query":[{"key":"testMode","value":"false"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"subscriber\": {\n        \"vasToken\": \"adsfgsfg-adfadfga\",\n        \"associateId\": 0,\n        \"subscriptions\": [\n            {\n                \"status\": \"ACTIVE\",\n                \"start\": \"2020-09-10T13:58:18.650297Z\",\n                \"renew\": \"2020-10-10T13:58:18.650297Z\",\n                \"freePeriod\": 30,\n                \"productId\": 1250,\n                \"productName\": \"Basis med reklamer\",\n                \"agreementId\": \"Package 1\"\n            }\n        ]\n    },\n    \"testMode\": false\n}"}],"_postman_id":"a4b895ae-c776-485b-8822-ab7c0bd55ca7"},{"name":"Fetch subscriber","id":"04e696d4-194c-4d47-8436-1425731a82ab","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"}],"url":"https://play-partner.tv2api.dk/subscribers/{{vasToken}}?testMode={{testMode}}","description":"<p>This request fetches a subscriber by VAS token.</p>\n<h2 id=\"parameters\">Parameters</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th>Data Type</th>\n<th>M/O</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>partnerKey</td>\n<td>Header</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>A unique partner key handed to the partner by TV 2.</td>\n</tr>\n<tr>\n<td>vasToken</td>\n<td>Path</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>The unique identifier of the subscriber.</td>\n</tr>\n<tr>\n<td>testMode</td>\n<td>Query</td>\n<td>Boolean</td>\n<td>Optional</td>\n<td>If set to true, it means the service is in test mode and returned data is not production data, but is instead a fixed data set. Default value is false.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["subscribers","{{vasToken}}"],"host":["https://play-partner.tv2api.dk"],"query":[{"key":"testMode","value":"{{testMode}}"}],"variable":[]}},"response":[{"id":"0a2d0360-3d67-450e-a65a-eff2a0c7c271","name":"Fetch subscriber","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"}],"url":{"raw":"https://play-partner.tv2api.dk/subscribers/adsfgsfg-adfadfga?testMode=false","host":["https://play-partner.tv2api.dk"],"path":["subscribers","adsfgsfg-adfadfga"],"query":[{"key":"testMode","value":"false"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"subscriber\": {\n        \"vasToken\": \"adsfgsfg-adfadfga\",\n        \"associateId\": 11901,\n        \"subscriptions\": [\n            {\n                \"status\": \"ACTIVE\",\n                \"start\": \"2020-09-14T08:19:34.407602Z\",\n                \"renew\": \"2020-10-14T08:19:34.407602Z\",\n                \"freePeriod\": 30,\n                \"productId\": 1250,\n                \"productName\": \"Basis med reklamer\",\n                \"agreementId\": \"Agreement1\"\n            }\n        ]\n    },\n    \"testMode\": false\n}"}],"_postman_id":"04e696d4-194c-4d47-8436-1425731a82ab"},{"name":"Fetch subscribers","id":"86f8e1da-a914-4b21-a8bd-361056733e51","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"}],"url":"https://play-partner.tv2api.dk/subscribers?testMode={{testMode}}&page={{page}}&limit={{limit}}&status={{status}}","description":"<p>This request fetches a list of subscribers. The list is returned in pages with a size of no more than 100 subscribers. The page number and page size is declared by using the pagination parameters <em>page</em> and <em>limit</em>.</p>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> If a subscriber has both an active and an expired subscription, both will be returned when fetching subscribers with <em>ACTIVE</em> subscriptions. Currently the status is limited to <em>ACTIVE</em>, which also is default. </p>\n</blockquote>\n<h2 id=\"parameters\">Parameters</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th>Data Type</th>\n<th>M/O</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>partnerKey</td>\n<td>Header</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>A unique partner key handed to the partner by TV 2.</td>\n</tr>\n<tr>\n<td>testMode</td>\n<td>Query</td>\n<td>Boolean</td>\n<td>Optional</td>\n<td>If set to true, it means the service is in test mode and returned data is not production data, but is instead a fixed data set. Default value is false.</td>\n</tr>\n<tr>\n<td>page</td>\n<td>Query</td>\n<td>Number</td>\n<td>Optional</td>\n<td>The page number. Default value is 1. If page &lt; 1, page will be set to default.</td>\n</tr>\n<tr>\n<td>limit</td>\n<td>Query</td>\n<td>Number</td>\n<td>Optional</td>\n<td>The limit/size of the page. Default value is 100. If limit &lt;= 0 or limit &gt; 100, limit will be set to the default value.</td>\n</tr>\n<tr>\n<td>status</td>\n<td>Query</td>\n<td>String</td>\n<td>Optional</td>\n<td>The status of the subscriber’s subscriptions. Currently limited to only ACTIVE. Default value is ACTIVE.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["subscribers"],"host":["https://play-partner.tv2api.dk"],"query":[{"key":"testMode","value":"{{testMode}}"},{"key":"page","value":"{{page}}"},{"key":"limit","value":"{{limit}}"},{"key":"status","value":"{{status}}"}],"variable":[]}},"response":[{"id":"0516b978-911b-460d-aa70-4cafc0393973","name":"Fetch subscribers","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"}],"url":{"raw":"https://play-partner.tv2api.dk/subscribers?testMode={{testMode}}&page={{page}}&limit={{limit}}&status={{status}}","host":["https://play-partner.tv2api.dk"],"path":["subscribers"],"query":[{"key":"testMode","value":"{{testMode}}"},{"key":"page","value":"{{page}}"},{"key":"limit","value":"{{limit}}"},{"key":"status","value":"{{status}}"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"pagination\": {\n        \"page\": 1,\n        \"limit\": 2,\n        \"recordsReturned\": 2,\n        \"totalRecords\": 10\n    },\n    \"content\": [\n        {\n            \"vasToken\": \"sdf522sg-sdj49dfl\",\n            \"associateId\": 0,\n            \"subscriptions\": [\n                {\n                    \"status\": \"ACTIVE\",\n                    \"start\": \"2020-09-14T08:19:34.407602Z\",\n                    \"renew\": \"2020-10-14T08:19:34.407602Z\",\n                    \"freePeriod\": 30,\n                    \"productId\": 1250,\n                    \"productName\": \"Basis med reklamer\",\n                    \"agreementId\": \"Agreement1\"\n                }\n            ]\n        },\n        {\n            \"vasToken\": \"dgjkj26h-nsf78ssA\",\n            \"associateId\": 0,\n            \"subscriptions\": [\n                {\n                    \"status\": \"ACTIVE\",\n                    \"start\": \"2020-09-10T13:58:18.650297Z\",\n                    \"renew\": \"2020-10-10T13:58:18.650297Z\",\n                    \"freePeriod\": 30,\n                    \"productId\": 1250,\n                    \"productName\": \"Basis med reklamer\",\n                    \"agreementId\": \"Agreement1\"\n                }\n            ]\n        }\n    ],\n    \"testMode\": false \n}"}],"_postman_id":"86f8e1da-a914-4b21-a8bd-361056733e51"},{"name":"Update subscriber","id":"27f46c4d-6487-4446-9b93-51689b9dfa0b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n    \"vasToken\": \"{{newVasToken}}\",\r\n    \"email\": \"{{newEmail}}\",\r\n    \"firstName\" : \"{{newFirstName}}\",\r\n    \"birthYear\": {{newBirthYear}},\r\n    \"gender\": \"{{newGender}}\",\r\n    \"associateId\": {{newAssociateId}}\r\n}"},"url":"https://play-partner.tv2api.dk/subscribers/{{vasToken}}?testMode={{testMode}}","description":"<p>This request updates a subscriber. The updatable properties at the subscriber are: vasToken, email, firstName, birthYear, gender and associate ID. It is possible to update just one or a few of the properties by omitting the rest of the properties at the request body. Please browse the example requests to see how to update all properties, update only the vasToken or update only the email.</p>\n<h2 id=\"parameters\">Parameters</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th>Data Type</th>\n<th>M/O</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>partnerKey</td>\n<td>Header</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>A unique partner key handed to the partner by TV 2.</td>\n</tr>\n<tr>\n<td>vasToken</td>\n<td>Path</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>The unique identifier of the subscriber. This is the subscriber’s current VAS token.</td>\n</tr>\n<tr>\n<td>testMode</td>\n<td>Query</td>\n<td>Boolean</td>\n<td>Optional</td>\n<td>If set to true, it means the service is in test mode and no subscribers will actually be updated. Default is false.</td>\n</tr>\n<tr>\n<td>vasToken</td>\n<td>Body</td>\n<td>String</td>\n<td>Optional</td>\n<td>The VAS token to be applied.</td>\n</tr>\n<tr>\n<td>email</td>\n<td>Body</td>\n<td>String</td>\n<td>Optional</td>\n<td>The email to be applied.</td>\n</tr>\n<tr>\n<td>firstName</td>\n<td>Body</td>\n<td>String</td>\n<td>Optional</td>\n<td>The first name to be applied.</td>\n</tr>\n<tr>\n<td>birthYear</td>\n<td>Body</td>\n<td>Number</td>\n<td>Optional</td>\n<td>The birth year to be applied. The format is YYYY.</td>\n</tr>\n<tr>\n<td>gender</td>\n<td>Body</td>\n<td>String</td>\n<td>Optional</td>\n<td>The gender to be applied. It can be either F (female), M (male) or U (unknown).</td>\n</tr>\n<tr>\n<td>associateId</td>\n<td>Body</td>\n<td>Number</td>\n<td>Optional</td>\n<td>The associate ID to be applied.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["subscribers","{{vasToken}}"],"host":["https://play-partner.tv2api.dk"],"query":[{"key":"testMode","value":"{{testMode}}"}],"variable":[]}},"response":[{"id":"45e37b60-8a9f-4f38-933d-d5e52acba16d","name":"Update subscriber (all properties)","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"vasToken\": \"aaa-bbb-ccc-ddd\",\r\n    \"email\": \"new.email@partner.tv2.dk\",\r\n    \"firstName\" : \"Newname\",\r\n    \"birthYear\": 1975,\r\n    \"gender\": \"F\",\r\n    \"associateId\": 123456\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://play-partner.tv2api.dk/subscribers/adsfgsfg-adfadfga?testMode=false","host":["https://play-partner.tv2api.dk"],"path":["subscribers","adsfgsfg-adfadfga"],"query":[{"key":"testMode","value":"false"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"subscriber\": {\n        \"vasToken\": \"aaa-bbb-ccc-ddd\",\n        \"associateId\": 123456,\n        \"subscriptions\": [\n            {\n                \"status\": \"ACTIVE\",\n                \"start\": \"2020-09-14T08:19:34.407602Z\",\n                \"renew\": \"2020-10-14T08:19:34.407602Z\",\n                \"freePeriod\": 30,\n                \"productId\": 1250,\n                \"productName\": \"Basis med reklamer\",\n                \"agreementId\": \"Package 1\"\n            }\n        ]\n    },\n    \"testMode\": false\n}"},{"id":"03b1ab3b-5747-4ad4-b23a-972001bbd377","name":"Update email","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n\t\"email\": \"new.email@partner.tv2.dk\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://play-partner.tv2api.dk/subscribers/adsfgsfg-adfadfga?testMode=false","host":["https://play-partner.tv2api.dk"],"path":["subscribers","adsfgsfg-adfadfga"],"query":[{"key":"testMode","value":"false"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"subscriber\": {\n        \"vasToken\": \"adsfgsfg-adfadfga?\",\n        \"associateId\": 111111,\n        \"subscriptions\": [\n            {\n                \"status\": \"ACTIVE\",\n                \"start\": \"2020-09-14T08:19:34.407602Z\",\n                \"renew\": \"2020-10-14T08:19:34.407602Z\",\n                \"freePeriod\": 30,\n                \"productId\": 1250,\n                \"productName\": \"Basis med reklamer\",\n                \"agreementId\": \"Package 1\"\n            }\n        ]\n    },\n    \"testMode\": false\n}"},{"id":"313d3773-4a22-46c6-af6f-c1b849e1353f","name":"Update vasToken","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"vasToken\": \"aaa-bbb-ccc-ddd\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://play-partner.tv2api.dk/subscribers/adsfgsfg-adfadfga?testMode=false","host":["https://play-partner.tv2api.dk"],"path":["subscribers","adsfgsfg-adfadfga"],"query":[{"key":"testMode","value":"false"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"subscriber\": {\n        \"vasToken\": \"aaa-bbb-ccc-ddd\",\n        \"associateId\": 111111,\n        \"subscriptions\": [\n            {\n                \"status\": \"ACTIVE\",\n                \"start\": \"2020-09-14T08:19:34.407602Z\",\n                \"renew\": \"2020-10-14T08:19:34.407602Z\",\n                \"freePeriod\": 30,\n                \"productId\": 1250,\n                \"productName\": \"Basis med reklamer\",\n                \"agreementId\": \"Package 1\"\n            }\n        ]\n    },\n    \"testMode\": false\n}"}],"_postman_id":"27f46c4d-6487-4446-9b93-51689b9dfa0b"},{"name":"Remove subscriber","id":"3ed77b06-8864-4bea-99ea-8d35c20b0e63","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"url":"https://play-partner.tv2api.dk/subscribers/{{vasToken}}?testMode={{testMode}}","description":"<p>This request removes/detaches a subscriber from the partner. By removing the subscriber, the subscription is closed and the subscriber's VAS token and email is made available for future creation. The request requires a VAS token and will remove the subscriber of that VAS token. When a subscriber is removed, it is no longer linked to the partner. The subscriber and its subscription can no longer be fetched or updated.</p>\n<p>In summery, use remove subscriber to:</p>\n<ol>\n<li><p>delete a subscriber,</p>\n</li>\n<li><p>close a subscription and</p>\n</li>\n<li><p>free up VAS token and email for use at create subscriber or update subscription.</p>\n</li>\n</ol>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> Although the subscription is closed when removing a subscriber, the TV 2 user persists and the end-user can continue to login into TV 2 Play and other TV 2 services. If the TV 2 user has non-expired subscriptions at other partners or directly at TV 2, the end-user continue to have access to watch content granted by those subscriptions. </p>\n</blockquote>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> The remove subscriber request does not effect other partners. If the subscriber's TV 2 user has subscribers at multiple partners, the other partners can continue to fetch and update the subscribers and subscriptions belonging to that partner. </p>\n</blockquote>\n<h2 id=\"parameters\">Parameters</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th>Data Type</th>\n<th>M/O</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>partnerKey</td>\n<td>Header</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>A unique partner key handed to the partner by TV 2.</td>\n</tr>\n<tr>\n<td>vasToken</td>\n<td>Path</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>The unique identifier of the subscriber.</td>\n</tr>\n<tr>\n<td>testMode</td>\n<td>Query</td>\n<td>Boolean</td>\n<td>Optional</td>\n<td>If set to true, it means the service is in test mode and no subscribers will actually be removed. Default is false.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["subscribers","{{vasToken}}"],"host":["https://play-partner.tv2api.dk"],"query":[{"key":"testMode","value":"{{testMode}}"}],"variable":[]}},"response":[{"id":"7496c94f-16d8-4b44-a72b-3de59ebbd1a5","name":"Remove subscriber","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"url":{"raw":"https://play-partner.tv2api.dk/subscribers/adsfgsfg-adfadfga?testMode=false","host":["https://play-partner.tv2api.dk"],"path":["subscribers","adsfgsfg-adfadfga"],"query":[{"key":"testMode","value":"false"}]}},"status":"No Content","code":204,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"3ed77b06-8864-4bea-99ea-8d35c20b0e63"},{"name":"Update subscription","id":"0e65e1e9-2bd3-46da-aa55-7150115cf594","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\r\n    \"productId\": {{newProductId}},\r\n    \"agreementId\": \"{{newAgreementId}}\"\r\n}"},"url":"https://play-partner.tv2api.dk/subscribers/{{vasToken}}/subscriptions/{{productId}}?testMode={{testMode}}","description":"<p>This request updates a subscription. The updatable properties at the subscription are: productId and agreementId. It is possible to update just one of the properties by omitting the other at the request body.</p>\n<p>If the product ID is updated exclusively, the new product ID is validated against the current agreement ID. If the agreement ID is updated exclusively, the new agreement ID is validated against the current product ID. If both the product ID and agreement ID is updated, the new product ID is validated against the new agreement ID.</p>\n<p>Please browse the example requests to see how to update all properties, update only the productId or update only the agreementId.</p>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> Updating the product ID may result in a Product Unavailable error, if the agreement ID does not include the product ID, or a Product Change Violation error, if the product change violates the product change rules of the agreement ID. Product Change Violation errors can only occur, if the product is changed to another product within the same agreement ID, e.g. if the agreement ID is not updated. </p>\n</blockquote>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> Updating the agreement ID may result in a Product Unavailable error, if the agreement ID does not include the product ID. </p>\n</blockquote>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> Updating the agreement ID may result in an Unknown Agreement Error, if a non-existing agreement ID has been used. </p>\n</blockquote>\n<blockquote>\n<p><em><strong>NOTE:</strong></em> Changing the product of a subscription by updating the product ID will not replace/close subscriptions given by TV 2 or other partners. </p>\n</blockquote>\n<h2 id=\"parameters\">Parameters</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th>Data Type</th>\n<th>M/O</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>partnerKey</td>\n<td>Header</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>A unique partner key handed to the partner by TV 2.</td>\n</tr>\n<tr>\n<td>vasToken</td>\n<td>Path</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>The unique identifier of the subscriber.</td>\n</tr>\n<tr>\n<td>productId</td>\n<td>Path</td>\n<td>Number</td>\n<td>Mandatory</td>\n<td>The product ID of the subscription that is to be updated.</td>\n</tr>\n<tr>\n<td>testMode</td>\n<td>Query</td>\n<td>Boolean</td>\n<td>Optional</td>\n<td>If set to true, it means the service is in test mode and no subscriptions will actually be updated. Default is false.</td>\n</tr>\n<tr>\n<td>productId</td>\n<td>Body</td>\n<td>Number</td>\n<td>Optional</td>\n<td>The product ID to be applied.</td>\n</tr>\n<tr>\n<td>agreementId</td>\n<td>Body</td>\n<td>String</td>\n<td>Optional</td>\n<td>The agreement ID to be applied.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["subscribers","{{vasToken}}","subscriptions","{{productId}}"],"host":["https://play-partner.tv2api.dk"],"query":[{"key":"testMode","value":"{{testMode}}"}],"variable":[]}},"response":[{"id":"9c97dc4f-209b-4ea1-aa03-3dfc05aa4ee8","name":"Update productId","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"productId\": 1134\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://play-partner.tv2api.dk/subscribers/adsfgsfg-adfadfga/subscriptions/1250?testMode=false","host":["https://play-partner.tv2api.dk"],"path":["subscribers","adsfgsfg-adfadfga","subscriptions","1250"],"query":[{"key":"testMode","value":"false"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"subscription\": {\n        \"status\": \"ACTIVE\",\n        \"start\": \"2020-09-14T13:59:53.141225Z\",\n        \"renew\": \"2020-10-14T08:19:34.407602Z\",\n        \"freePeriod\": 30,\n        \"productId\": 1134,\n        \"productName\": \"Favorit uden reklamer\",\n        \"agreementId\": \"Package 1\"\n    },\n    \"testMode\": false\n}"},{"id":"b90f4570-3a12-43b7-910d-7ad4b22d3aa4","name":"Update subscription (all properties)","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"productId\": 1134,\r\n    \"agreementId\": \"Package 2\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://play-partner.tv2api.dk/subscribers/adsfgsfg-adfadfga/subscriptions/1250?testMode=false","host":["https://play-partner.tv2api.dk"],"path":["subscribers","adsfgsfg-adfadfga","subscriptions","1250"],"query":[{"key":"testMode","value":"false"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"subscription\": {\n        \"status\": \"ACTIVE\",\n        \"start\": \"2020-09-14T13:59:53.141225Z\",\n        \"renew\": \"2020-10-14T08:19:34.407602Z\",\n        \"freePeriod\": 30,\n        \"productId\": 1134,\n        \"productName\": \"Favorit uden reklamer\",\n        \"agreementId\": \"Package 2\"\n    },\n    \"testMode\": false\n}"},{"id":"c4b23a0e-9c06-4a98-a0dd-c4556eb55611","name":"Update agreementId","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"agreementId\": \"Package 2\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://play-partner.tv2api.dk/subscribers/adsfgsfg-adfadfga/subscriptions/1250?testMode=false","host":["https://play-partner.tv2api.dk"],"path":["subscribers","adsfgsfg-adfadfga","subscriptions","1250"],"query":[{"key":"testMode","value":"false"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"subscription\": {\n        \"status\": \"ACTIVE\",\n        \"start\": \"2020-09-14T13:59:53.141225Z\",\n        \"renew\": \"2020-10-14T08:19:34.407602Z\",\n        \"freePeriod\": 30,\n        \"productId\": 1250,\n        \"productName\": \"Basis med reklamer\",\n        \"agreementId\": \"Package 2\"\n    },\n    \"testMode\": false\n}"}],"_postman_id":"0e65e1e9-2bd3-46da-aa55-7150115cf594"},{"name":"Fetch product","id":"b638d45e-9e8c-42b8-8a21-54a98c29581c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"url":"https://play-partner.tv2api.dk/products/{{productId}}?testMode={{testMode}}","description":"<p>This request fetches a single product. The product contains a product ID and the full product name.</p>\n<h2 id=\"parameters\">Parameters</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th>Data Type</th>\n<th>M/O</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>partnerKey</td>\n<td>Header</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>A unique partner key handed to the partner by TV 2.</td>\n</tr>\n<tr>\n<td>productId</td>\n<td>Path</td>\n<td>Number</td>\n<td>Mandatory</td>\n<td>The product ID of a TV 2 Play product.</td>\n</tr>\n<tr>\n<td>testMode</td>\n<td>Query</td>\n<td>Boolean</td>\n<td>Optional</td>\n<td>If set to true, it means the service is in test mode and the returned map of products is static and unrelated to the partner setup. Default is false.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["products","{{productId}}"],"host":["https://play-partner.tv2api.dk"],"query":[{"key":"testMode","value":"{{testMode}}"}],"variable":[]}},"response":[{"id":"701f0915-1603-4188-8713-e677435fdc33","name":"Fetch product","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"}],"url":{"raw":"https://play-partner.tv2api.dk/products/1134?testMode=false","host":["https://play-partner.tv2api.dk"],"path":["products","1134"],"query":[{"key":"testMode","value":"false"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"product\": {\n        \"id\": 1134,\n        \"name\": \"Favorit uden reklamer\"\n    },\n    \"testMode\": false\n}"}],"_postman_id":"b638d45e-9e8c-42b8-8a21-54a98c29581c"},{"name":"Fetch products","id":"0f531614-5a7c-49c0-a41b-1a773637187f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"}],"url":"https://play-partner.tv2api.dk/products?testMode={{testMode}}","description":"<p>This request fetches products available for the partner. The response contains a map of agreement ID's and products. Each product contains a product ID and the full product name.</p>\n<h2 id=\"parameters\">Parameters</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th>Data Type</th>\n<th>M/O</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>partnerKey</td>\n<td>Header</td>\n<td>String</td>\n<td>Mandatory</td>\n<td>A unique partner key handed to the partner by TV 2.</td>\n</tr>\n<tr>\n<td>testMode</td>\n<td>Query</td>\n<td>Boolean</td>\n<td>Optional</td>\n<td>If set to true, it means the service is in test mode and the returned map of products is static and unrelated to the partner setup. Default is false.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["products"],"host":["https://play-partner.tv2api.dk"],"query":[{"key":"testMode","value":"{{testMode}}"}],"variable":[]}},"response":[{"id":"0c7d0ec6-41f1-4ee1-9b62-a6b487c5e0ee","name":"Fetch products","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{partnerKey}}"},{"key":"Accept","value":"application/json"}],"url":{"raw":"https://play-partner.tv2api.dk/products?testMode={{testMode}}","host":["https://play-partner.tv2api.dk"],"path":["products"],"query":[{"key":"testMode","value":"{{testMode}}"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"agreementIds\": {\n        \"Package 1\": [\n            {\n                \"id\": 1134,\n                \"name\": \"Favorit uden reklamer\"\n            },\n            {\n                \"id\": 1194,\n                \"name\": \"Basis uden reklamer\"\n            },\n            {\n                \"id\": 1250,\n                \"name\": \"Basis med reklamer\"\n            },\n            {\n                \"id\": 1251,\n                \"name\": \"Favorit med reklamer\"\n            }\n        ],\n        \"Package 2\": [\n            {\n                \"id\": 1263,\n                \"name\": \"Favorit + Sport uden reklamer\"\n            }\n        ]\n    },\n    \"testMode\": false\n}"}],"_postman_id":"0f531614-5a7c-49c0-a41b-1a773637187f"}],"event":[{"listen":"prerequest","script":{"id":"c6e14615-a47a-4e64-9feb-7ed359aa1903","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"6bd8ded2-25c3-4b6b-acfc-56e53fc2b792","type":"text/javascript","exec":[""]}}],"variable":[{"key":"baseUrl","value":"https://play-partner.tv2api.dk"}]}