Add Subscription

Endpoint

POST /subscriptions - adds new podcast subscription for an user

Parameters

Parameter Parameter Type Data Type
api-key header string Required
Authorization header string Required
podcast_id post param string Required

Error messages

  • invalid HTTP_API_KEY
  • Not authenticated

HTTP response codes:

  • 200 - Success
  • 401 - Unauthorized action

Example request

curl --request POST \
  --url https://api-dev.radiozu.ro/v1/subscriptions \
  --header 'Authorization: Bearer AUTH_TOKEN' \
  --header 'api-key: API_KEY' \
  --data podcast_id=2 

Response fields

A subscription object containing a link between an user and a podcast.

  • id - id of subscription, to be used for deletion of subscription
  • user_id - user_id of subscription
  • podcast_id - id of the subscribed podcast

Example response

{
	"data": {
		"id": 6,
		"podcast_id": "2",
		"user_id": 1
	}
}