UserStory
This is an object representing an User's watch history. The API allows you to retrieve individual UserStory as well as a list of them using various filters. Furthermore it lets you create, update and delete an UserStory.
UserStory is used to synchronize data between AniAPI and external Anime tracking systems.
#
The UserStory object#
Attributesinteger#
idUnique identifier for an UserStory.
integer#
user_idUser external unique identifier.
string#
anime_idAnime external unique identifier.
enum#
statusThe UserStory's watching status.
"CURRENT": 0,"PLANNING": 1,"COMPLETED": 2,"DROPPED": 3,"PAUSED": 4,"REPEATING": 5
integer#
current_episodeThe UserStory's watching progress.
integer#
current_episode_ticksThe UserStory's current_episode
watching time in milliseconds.
#
Example{ "user_id": 1, "anime_id": 10, "status": 2, "current_episode": 220, "current_episode_ticks": 0, "id": 27}
#
Retrieve a specific UserStoryRetrieves an UserStory, based on its unique identifier.
#
ParametersNo parameters.
#
ReturnsReturns an UserStory object if a valid identifier was provided and the authenticated User owns the rights to get it.
#
Try it
#
Get a list of UserStoryReturns a list of UserStory objects.
The UserStories are returned sorted by creation_date
, following descending order.
info
As default, it will return all the UserStories owned by the request's authenticated User using the user_id
filter's field.
#
Parametersinteger optional#
anime_idA filter on the list based on the anime_id
field value.
integer default#
user_idA filter on the list based on the user_id
field value.
enum optional#
statusA filter on the list based on the status
field value.
bool optional#
syncedA filter on the list based on the synced
field value.
synced
field indicates if an UserStory has been synchronized with User's linked trackers.
#
ReturnsReturns an array of UserStory objects with a size based on the filter provided.
#
Try it
#
Create an UserStoryCreates an UserStory based on the provided values.
#
Parametersinteger required#
user_idThe User's id that own the UserStory.
integer required#
anime_idThe UserStory's Anime.
enum required#
statusThe UserStory's watching status.
integer optional#
current_episodeThe UserStory's watching progress.
Must be equal or less than the Anime's episodes_count
value.
When you provide a status
equal to 1
or 2
this field is auto-calculated.
integer optional#
current_episode_ticksThe UserStory's current_episode
watching time in milliseconds.
#
ReturnsReturns the created UserStory object.
#
Examplefetch('https://api.aniapi.com/v1/user_story', { method: 'PUT', headers: { 'Authorization': 'Bearer <YOUR_JWT>', 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: { user_id: 1, anime_id: 10, status: 2 }});
{ "status_code": 200, "message": "Story created", "data": { "user_id": 1, "anime_id": 10, "status": 2, "current_episode": 220, "current_episode_ticks": 0, "id": 1 }, "version": "1"}
#
Update an UserStoryUpdates an UserStory based on the provided values.
#
Parametersinteger required#
idThe UserStory's unique identifier.
integer required#
user_idThe User's id that owns the UserStory.
integer required#
anime_idThe UserStory's Anime.
enum required#
statusThe UserStory's watching status.
integer required#
current_episodeThe UserStory's watching progress.
Must be equal or less than the Anime's episodes_count
value.
integer required#
current_episode_ticksThe UserStory's current_episode
watching time in milliseconds.
#
ReturnsReturns the updated UserStory object.
#
Examplefetch('https://api.aniapi.com/v1/user_story', { method: 'POST', headers: { 'Authorization': 'Bearer <YOUR_JWT>', 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: { id: 27, user_id: 1, anime_id: 10, status: 0, current_episode: 140, current_episode_ticks: 1200000 }});
{ "status_code": 200, "message": "Story updated", "data": { "user_id": 1, "anime_id": 10, "status": 0, "current_episode": 140, "current_episode_ticks": 1200000, "id": 27 }, "version": "1"}
#
Delete an UserStoryDeletes an UserStory based on the provided unique identifier.
caution
You should use this endpoint only when the User has zero linked trackers. Otherwise the UserStory will get re-imported!
#
ParametersNo parameters.
#
ReturnsNo particular return.
#
Examplefetch('https://api.aniapi.com/v1/user_story/27', { method: 'DELETE', headers: { 'Authorization': 'Bearer <YOUR_JWT>', 'Content-Type': 'application/json', 'Accept': 'application/json' }});
{ "status_code": 200, "message": "Story deleted", "data": "", "version": "1"}