restnotificationsyoutrackyoutrack-api

How do I access user notifications via REST in YouTrack?


I can't for the life of me find the documentation on how to access user notifications via the REST-API. Everything is activated and allowed in the admin settings, but what is the correct url to fetch them?


Solution

  • Here's how to fetch notifications from YouTrack 2018.1+:

    1. Make GET request to <youtrack_url>/api/users/notifications?fields=id,content,metadata. This will return notifications for a current user. To get notifications for all users at once use all=true request URL parameter. The latter requires admin permissions though.
    2. The response contains fields content and metadata gzipped and base64 decoded, so decode them.Content stands for prerendered notification text, while metadata contains source notification data.

    Each notification is stored for one hour, so you may want to fetch them often.