Subscriptions endpoint draft spec #12
Replies: 4 comments 21 replies
-
Just a note: this doesn't include the data flow or database structure for this information. I'll write that up separately. |
Beta Was this translation helpful? Give feedback.
-
Some first-read quick feedback on a formal level:
|
Beta Was this translation helpful? Give feedback.
-
I think a huge issue we haven't covered yet needs to be solved: The GUID in the RSS-Feed has the highest priority. This means when I create a new subscription using the A possible solution would be to try to fetch the Feed, extract the GUID and everything is fine. Only if this doesn't work in a short amount of time, we generate an GUID. The server may then try to fetch the Feed in the background from time to time in order to update if required. I just checked the proposal again and I think there is no specification for fetching the Feed URL anyways, which probably should be changed. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure in which case the edit: the problem that could occur is that the state |
Beta Was this translation helpful? Give feedback.
-
Subscriptions endpoint
The subscriptions endpoint is used to synchronize subscriptions between a server and connected clients. A client can perform the following actions:
The server is treated as the authoritative source for subscription information. Clients can query the endpoint by specifying the datetime from which they want to fetch changes to ensure they only fetch information that is relevant to them since their last sync.
Authentication
All endpoints use Oauth 2 to authenticate. The exact mechanism is still open for discussion. Users create Oauth tokens by authenticating with an account on the server. When they query the endpoints, they are able to interact only with information relating to their account.
GUID authority
GUIDs are a feature of the Podcasting 2.0 specification which uniquely identify the podcast. To handle this and ensure that this API complies with the Podcasting 2.0 spec, all subscription entries must be assigned a GUID.
For the best compatibility, the following sources should be used in order of preference:
guid
field in the source RSS feed. This should not change at any point in the future and should be considered authoritativepodcastGuid
field returned by the Podcast Index's/podcasts/byfeedurl
endpoint. This should only be queried if:guid
field, possibly due to being out-of-dateguid
that is generated only if neither of the above sources contain any informationGet all subscriptions
This endpoint enables clients to return all subscription information relating to the authenticated user. It returns the following information:
feed_url
guid
is_subscribed
subscription_changed
is_subscribed
field was last updated. Presented in ISO 8601 formatguid_changed
new_guid
Parameters
The client can attach an optional
since
parameter in the path This is a Datetime parameter that specifies the range of data the endpoint will return. The endpoint will only return objects in which either thesubscription_changed
orguid_changed
fields were updated after the datetime specified in thesince
parameter.Server-side behavior
If the entry contains a
new_guid
, the server should return the newestguid
associated with the entry. For example: if a subscription has received 2 newguid
s, the server should follow these entries and only return the last one it finds. This ensures the client has the most up-to-date entry for the subscription.Example request
Example 200 response
Get a single subscription
This endpoint returns subscription information relating to a specific subscription for the authenticated user. It returns the following information:
feed_url
guid
is_subscribed
subscription_changed
is_subscribed
field was last updated. Presented in ISO 8601 formatguid_changed
new_guid
Server-side behavior
If the entry contains a
new_guid
, the server should return the newestguid
associated with the entry. For example: if a subscription has received 2 newguid
s, the server should follow these entries and only return the last one it finds. This ensures the client has the most up-to-date entry for the subscription.Example request
curl --location '/subscriptions/968cb508-803c-493c-8ff2-9e397dadb83c'
Example 200 response
Add new subscriptions
This endpoint enables clients to add new subscriptions to the system for the authenticated user. It returns the following information:
feed_url
guid
is_subscribed
subscription_changed
is_subscribed
field was last updated. Presented in ISO 8601 formatParameters
The client must provide an array of
feed_urls
in the request body to add them to the system.Server-side behavior
When new feeds are posted to the server, the server must perform the following actions:
guid
field and save this as theguid
if it exists/podcasts/byfeedurl
endpoint for the feed in question. If there is a response and it contains apodcastGuid
field, save this value as theguid
guid
is found, generate a new one and assign it to the entry'sguid
field.is_subscribed
field totrue
Example request
Example 200 response
Update an existing subscription
This endpoint allows clients to update information about a subscription. It returns the following information:
new_feed_url
feed_url
field was updated by the requestis_subscribed
is_subscribed
field was updated by the requestsubscription_changed
is_subscribed
field was last updated. Presented in ISO 8601 format. Only returned if theis_subscribed
field was updated by the requestguid_changed
guid
field was updated by the requestnew_guid
guid
field was updated by the requestParameters
The client must provide an the following parameters in the request body:
new_feed_url
new_guid
is_subscribed
Example request
Example 200 response
Delete an existing subscription
This endpoint allows clients to mark a feed as deleted. This prevents the server from updating the feed in the background and prevents the server returning any information such as playback positions relating to the given associated feed. It returns the following information:
feed_url
guid
is_deleted
Server-side behavior
When a
DELETE
request is received, the server must do the following:is_deleted
flag in the subscriptions table totrue
is_deleted
flag on any previous entries in the subscriptions table relating to the feed totrue
Example request
curl --location --request POST '/subscriptions/2d8bb39b-8d34-48d4-b223-a0d01eb27d71'
Example 200 response
Beta Was this translation helpful? Give feedback.
All reactions