# Getting the notifications from an user

**URL:** https://meta.discourse.org/t/getting-the-notifications-from-an-user/174919
**Category:** Support
**Created:** [January 4, 2021, 5:10am UTC](https://meta.discourse.org/t/getting-the-notifications-from-an-user/174919 "2021-01-04T05:10:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Matthieu\_Rioual](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matthieu_rioual/32/204095_2.png) [@Matthieu\_Rioual](https://meta.discourse.org/u/Matthieu_Rioual)
#### Post date: [January 4, 2021, 5:10am UTC](https://meta.discourse.org/t/getting-the-notifications-from-an-user/174919/1 "2021-01-04T05:10:05Z")

</div>

Echoing to this topic : [How to allow users to get their API Key - #4](https://meta.discourse.org/t/how-to-allow-users-to-get-their-api-key/174140/4) , I decided to make my application only for admin who can create an API Key easily through the /admin panel. The application is working when but there is a problem i must solve : the API key has to have the global key access (it means reading and writing) to access the endpoint /notifications.json?username=theusername. On the API creation panel i can see there is a scope “show” that allow access to endpoint “/users/:username/notifications”. But when i try to use the scoped key with postman to this URL i receive HTML code. Same for “/users/:username/notifications.json” that will send me informations about the user but not about notifications. Plus, i don’t have the access to /notifications.json?username=… only with this scope. I conclude that the global key is the only solution to get the notifications right ? Thanks for your help

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 4, 2021, 4:10pm UTC](https://meta.discourse.org/t/getting-the-notifications-from-an-user/174919/2 "2021-01-04T16:10:10Z")

</div>

> [@Matthieu\_Rioual](#):
>
> the API key has to have the global key access (it means reading and writing) to access the endpoint /notifications.json?username=theusername.

I can’t reproduce this.

Got an Admin API key like this:

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/8/2863dfa0b1759d6d2671ce1992b58abd02255709.png)

and the following cURL request work fine:

```plaintext
➜ ~ curl 'https://meta.discourse.org/u/falco/notifications.json' \
-H "Api-Key: whyisthisapikeysolonglol"

```

---

<div class="post-metadata">

### Author: ![Matthieu\_Rioual](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matthieu_rioual/32/204095_2.png) [@Matthieu\_Rioual](https://meta.discourse.org/u/Matthieu_Rioual)
#### Post date: [January 4, 2021, 5:17pm UTC](https://meta.discourse.org/t/getting-the-notifications-from-an-user/174919/3 "2021-01-04T17:17:01Z")

</div>

Thanks again for your response Falco, like i told this url effectively sent me a response but it’s not concerning the notifications but the user informations like can witness this image:

 ![notnotifications](https://global.discourse-cdn.com/meta/original/3X/a/3/a3b1d95804d4aa440dadd8dd96383ae3e2af1ee0.png)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 4, 2021, 6:12pm UTC](https://meta.discourse.org/t/getting-the-notifications-from-an-user/174919/4 "2021-01-04T18:12:33Z")

</div>

That is indeed true!

Looks like the route `/u/:username/notifications` is just a browser route, and the Ember app will just use the standard `/notifications.json` route to grab the actual data. And that route isn’t on the list of possible scopes of admin API keys at the moment.

So it’s either User API Key or scope-less Admin API key for notifications currently.

---

<div class="post-metadata">

### Author: ![Matthieu\_Rioual](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matthieu_rioual/32/204095_2.png) [@Matthieu\_Rioual](https://meta.discourse.org/u/Matthieu_Rioual)
#### Post date: [January 4, 2021, 6:25pm UTC](https://meta.discourse.org/t/getting-the-notifications-from-an-user/174919/5 "2021-01-04T18:25:04Z")

</div>

Thanks that’s all i needed for information. Greetings 🙂

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [February 3, 2021, 6:25pm UTC](https://meta.discourse.org/t/getting-the-notifications-from-an-user/174919/6 "2021-02-03T18:25:05Z")

</div>

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