Increasing Play count via web api

Hi, im currently writing a little plex app with the aim to teaching me some angular and typescript. Everything is going well apart from one little issue:

via the web api im getting the play count of media items per user (pretty simple). The response contains the number of times the item has been played. I want to be able (via some sort of call) to increase that played number however its currently escaping me…

I can see via fiddler that a call is made to:

https://analytics.plex.tv/collect/event… i’ve replayed this event in fiddler however the count doesnt increase.

Any help would be appreciated.

I’ve worked out how to do it and thought I would post my findings if ever anyone else has the same challenge.

All you need to do is call the following endpoint twice:

http://[server-ip]:[server-port]/:/timeline/?ratingKey=[rating-key]&key=[key]&state=[state]&hasMDE=1&time=[time]&duration=[duration]&X-Plex-Token=[token]

Where:

[server-ip] = your server ip
[server-port] = your server port
[rating-key] = the rating key of the media item you wish to increase the count of
[key] = the key of the media item…
[state] = first time call should be “playing” and the second call should be “stopped”
[time] = first time call should be 0 and the second is the value of [duration]
[duration] = the total duration of the media item
[token] = your plex token

Do you have a working script that does that? Something more use friendly?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.