Get all subscriptions
This endpoint enables clients to return all subscription information relating to the authenticated user. It returns pagination information and an array of subscriptions
.
Response fields
Metadata
Field | Type | Required? | Description |
---|---|---|---|
total | Number | Yes | The total number of objects returned by the call |
page | Number | Yes | The number of the page returned in the call |
per_page | Number | Yes | The number of results returned per page |
next | String | No | The URL for the next page of results |
previous | String | No | The URL for the previous page of results |
Subscription fields
Field | Type | Required? | Description |
---|---|---|---|
feed_url | String | Yes | The URL of the podcast RSS feed |
guid | String<UUID> | Yes | The globally unique ID of the podcast |
is_subscribed | Boolean | Yes | Whether the user is subscribed to the podcast |
subscription_changed | Datetime | No | The date on which details relating to the subscription last changed. Presented in ISO 8601 format |
guid_changed | Datetime | No | The date on which the podcast’s guid or new_guid was last updated. Presented in ISO 8601 format |
new_guid | String<UUID> | No | The new GUID associated with the podcast |
deleted | Datetime | No | The date on which the subscription was deleted. Only returned if the field is not NULL |
Parameters
The client MAY add the following parameters to their call:
Field | Type | In | Required? | Description |
---|---|---|---|---|
since | DateTime | Query | No | The date from which the server should return objects. The server only returns entries whose subscription_changed , guid_changed , or deleted fields are greater than this parameter. Expected in ISO 8601 format |
page | Number | Query | No | The page of results to be returned by the server. Defaults to 1 if not present |
per_page | Number | Query | No | The number of results to return in each call. Defaults to 50 if not present |
Server-side behavior
If the entry contains a new_guid
, the server MUST return the newest guid
associated with the entry in the response’s new_guid
field. For example: if a subscription has received 2 new guid
s, the server MUST return:
- The subscription’s
guid
as it was at the date passed in thesince
parameter, or the original entry’sguid
if nosince
parameter is passed - The subscription’s latest
guid
in thenew_guid
field
This ensures the client has the most up-to-date entry for the subscription.
Client behavior
The client SHOULD update its local subscription data to match the information returned in the response. On receipt of a deleted subscription, the client SHOULD present the user with the option to remove their local data or send their local data to the server to reinstate the subscription details.
Resolution example
This example demonstrates how the server resolves a new_guid
field for a subscription that has received three GUIDs. Here is how the data is represented in the database:
feed_url | guid | is_subscribed | subscription_changed | guid_change | new_guid |
---|---|---|---|---|---|
https://example.com/rss1 | 64c1593b-5a1e-4e89-b8a3-d91501065e80 | true | 2022-03-21T18:45:35.513Z | 2022-03-21T19:00:00.000Z | daac3ce5-7b16-4cf0-8294-86ad71944a64 |
https://example.com/rss1 | daac3ce5-7b16-4cf0-8294-86ad71944a64 | true | 2022-03-21T18:45:35.513Z | 2022-12-23T10:24:14.670Z | 36a47c4c-4aa3-428a-8132-3712a8422002 |
https://example.com/rss1 | 36a47c4c-4aa3-428a-8132-3712a8422002 | true | 2022-03-21T18:45:35.513Z | 2022-12-23T10:24:14.670Z |
Scenario 1
In this scenario, the client requests all subscriptions and doesn’t pass a since
parameter. This means the server passes the original GUID in the guid
field, and the latest GUID in the new_guid
field.
Scenario 2
In this scenario, the client requests all subscriptions and specifies a since
date of 2022-05-30T00:00:00.000Z
. Since the first GUID change occurred before this date, and the second GUID change occurred after this date, the server responds with the second GUID in the guid
field, and the latest GUID in the new_guid
field.