Watchlist Guide

Each of the users of the Wurl system has a personal Watchlist (also known as "follows" list) they can use as a quick jumping point for their preferred content.

The watchlist guide covers the following:

  • Retrieving the Watchlist
  • Paging through the Watchlist
  • Adding to the Watchlist
  • Removing from the Watchlist

Retrieving the watchlist

To retrieve the watchlist, simply request /users/me/follows. me will be interpreted as the user associated with the access token provided.

$ curl -H 'Authorization: Bearer
ccb741c4245b4f5f93a9a4c44af575f6ea1c2d90c9f14ee69aaba4403be11b4e'
'http://api.wurl.com/api/users/me/follows'

You will receive a follows collection, containing a series of individual follow items.:

{
  "rel":["urn:x-resource:schema:http://api.wurl.com/schemas/follows.json"],
  "properties":{
     "totalItems":30,
     "currentCount":5
  },
  "entities":[
    // A list of follow entities
    {
      "rel":["properties:http://api.wurl.com/schemas/follow.json"],
      "class":["follow","follow_series"],
      "properties": {
        "id":1872,
        "pubDate":null,
        "title":"numberphile",
        "thumbnailLink":"http://static2.channels.com/thumbnails/assets/youtube-com/feeds/no_ids/Uploads-by-numberphile--jpg-v-d2fafc",
        "followedItemId":394490,"followedItemType":"series"},
        "entities":[
           {"rel":["urn:x-resource:name:series"],
           // Information for the series...
         ]
        "actions":[
          {"name":"unfollow","href":"http://api.wurl.com/api/users/1168/follows/1797","title":"Stop
following an item.","method":"DELETE"}
        ],
        "links":[
          {"rel":["self"],"href":"http://api.wurl.com/api/users/1168/follows/1797"},
          {"rel":["up"],"href":"http://api.wurl.com/api/users/1168/follows"}]}],
  "actions":[
    {  "name":"follow-series",
       "href":"http://api.wurl.com/api/users/1168/follows",
       "title":"Start following a series",
       "method":"POST",
       "fields":[{"name":"series_id","type":"text"}]
    }
  ],
  "links":[
    {"rel":["self"],
"href":"http://api.wurl.com/api/users/1168/follows"},
    {"rel":["up"],"href":"http://api.wurl.com/api/users/1168"},
    {"rel":["next"],"href":"http://api.wurl.com/api/users/1168/follows?count=5&since=5"}
   ]
  }

The follows collection may be paginated, depending on how many follows a user has.

Note - The items in the watchlist can potentially be entities other than series. Check the class of the items when you render them to insure you are rendering what you want.

Pagination

The links array may contain next and prev links to navigate backwards and forwards in the watchlist. If either link is not present it signifies that there are no further follow entities in the list.

Adding to the Watchlist

Adding to the watchlist involves grabbing the follow-series action of a series object and executing the action's request providing any empty parameters.,

For example, below you can see an action for follow-series and its corresponding translation for a curl call:

Sample follow action

{
  "name":"follow-series",
  "href":"http://api.wurl.com/api/users/1168/follows",
  "title":"Start following a series",
  "method":"POST",
  "fields":[{"name":"series_id","type":"text"}]
}

Corresponding Curl for series

$ curl -H 'Authorization: Bearer
ccb741c4245b4f5f93a9a4c44af575f6ea1c2d90c9f14ee69aaba4403be11b4e' -X POST -F series_id=12345 
'http://api.wurl.com/api/users/123/follows'

The response will contain the information for the new follow.

{
  "properties":{
    "message":"Created",
    "location":"http://api.wurl.com/api/users/1168/follows/1873"
  },
  "links":[
    {"rel":["self"],"href":"http://api.wurl.com/api/users/1168/follows/1873"}
  ]
}

Removing from the watchlist

To remove from the watchlist, use the "unfollow" action on the follow.

From the follows example on Add to Follows above:

curl -H 'Authorization: Bearer
d6add646f9b3fb34249f63d058fc5b5f2d3b7d67085c8bfedfb3aa02a1a78a7c' -X
DELETE 'http://api.wurl.com/api/users/1168/follows/1873'

A successful delete call returns no content. The HTTP status code will be 204 (No Content).

Watchlist Guide

Each of the users of the Wurl system has a personal Watchlist (also known as "follows" list) they can use as a quick jumping point for their preferred content.

The watchlist guide covers the following:

Retrieving the watchlist

To retrieve the watchlist, simply request /users/me/follows. me will be interpreted as the user associated with the access token provided.

$ curl -H 'Authorization: Bearer
ccb741c4245b4f5f93a9a4c44af575f6ea1c2d90c9f14ee69aaba4403be11b4e'
'http://api.wurl.com/api/users/me/follows'

You will receive a follows collection, containing a series of individual follow items.:

{
  "rel":["urn:x-resource:schema:http://api.wurl.com/schemas/follows.json"],
  "properties":{
     "totalItems":30,
     "currentCount":5
  },
  "entities":[
    // A list of follow entities
    {
      "rel":["properties:http://api.wurl.com/schemas/follow.json"],
      "class":["follow","follow_series"],
      "properties": {
        "id":1872,
        "pubDate":null,
        "title":"numberphile",
        "thumbnailLink":"http://static2.channels.com/thumbnails/assets/youtube-com/feeds/no_ids/Uploads-by-numberphile--jpg-v-d2fafc",
        "followedItemId":394490,"followedItemType":"series"},
        "entities":[
           {"rel":["urn:x-resource:name:series"],
           // Information for the series...
         ]
        "actions":[
          {"name":"unfollow","href":"http://api.wurl.com/api/users/1168/follows/1797","title":"Stop
following an item.","method":"DELETE"}
        ],
        "links":[
          {"rel":["self"],"href":"http://api.wurl.com/api/users/1168/follows/1797"},
          {"rel":["up"],"href":"http://api.wurl.com/api/users/1168/follows"}]}],
  "actions":[
    {  "name":"follow-series",
       "href":"http://api.wurl.com/api/users/1168/follows",
       "title":"Start following a series",
       "method":"POST",
       "fields":[{"name":"series_id","type":"text"}]
    }
  ],
  "links":[
    {"rel":["self"],
"href":"http://api.wurl.com/api/users/1168/follows"},
    {"rel":["up"],"href":"http://api.wurl.com/api/users/1168"},
    {"rel":["next"],"href":"http://api.wurl.com/api/users/1168/follows?count=5&since=5"}
   ]
  }

The follows collection may be paginated, depending on how many follows a user has.

Note - The items in the watchlist can potentially be entities other than series. Check the class of the items when you render them to insure you are rendering what you want.

Pagination

The links array may contain next and prev links to navigate backwards and forwards in the watchlist. If either link is not present it signifies that there are no further follow entities in the list.

Adding to the Watchlist

Adding to the watchlist involves grabbing the follow-series action of a series object and executing the action's request providing any empty parameters.,

For example, below you can see an action for follow-series and its corresponding translation for a curl call:

Sample follow action

{
  "name":"follow-series",
  "href":"http://api.wurl.com/api/users/1168/follows",
  "title":"Start following a series",
  "method":"POST",
  "fields":[{"name":"series_id","type":"text"}]
}

Corresponding Curl for series

$ curl -H 'Authorization: Bearer
ccb741c4245b4f5f93a9a4c44af575f6ea1c2d90c9f14ee69aaba4403be11b4e' -X POST -F series_id=12345 
'http://api.wurl.com/api/users/123/follows'

The response will contain the information for the new follow.

{
  "properties":{
    "message":"Created",
    "location":"http://api.wurl.com/api/users/1168/follows/1873"
  },
  "links":[
    {"rel":["self"],"href":"http://api.wurl.com/api/users/1168/follows/1873"}
  ]
}

Removing from the watchlist

To remove from the watchlist, use the "unfollow" action on the follow.

From the follows example on Add to Follows above:

curl -H 'Authorization: Bearer
d6add646f9b3fb34249f63d058fc5b5f2d3b7d67085c8bfedfb3aa02a1a78a7c' -X
DELETE 'http://api.wurl.com/api/users/1168/follows/1873'

A successful delete call returns no content. The HTTP status code will be 204 (No Content).