# Notification gateway api

**URL:** <https://forums.rocket.chat/t/notification-gateway-api/13463>\
**Category:** Development\
**Created:** [March 1, 2022, 5:22pm UTC](https://forums.rocket.chat/t/notification-gateway-api/13463 "2022-03-01T17:22:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![klonni](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/klonni/32/2309_2.png) [@klonni](https://forums.rocket.chat/u/klonni)\
**Post date:** [March 1, 2022, 5:22pm UTC](https://forums.rocket.chat/t/notification-gateway-api/13463/1 "2022-03-01T17:22:20Z")

</div>

I want to create my own notifications gateway. Looks like code of gateway is not published. Is there any docs on api of gateway? Cant find any

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [March 3, 2022, 11:02am UTC](https://forums.rocket.chat/t/notification-gateway-api/13463/2 "2022-03-03T11:02:18Z")

</div>

Hi! Welcome back to our forums 🙂

Here you have a discussion on this subject:

> [@Own push notification gateway](https://forums.rocket.chat/t/own-push-notification-gateway/7709/3):
>
> Ok, I understand that the only way out is to compile the application yourself. I would like to ask if the lack of push completely cuts off the possibility of notifications in the application? I understand push notifications as an overriding notification that should appear on the phone immediately. The notifications themselves, however, operating from the application level (in the background) should still communicate about the incoming message. Or so? To what extent can the lack of push make ou…

and here some docs on how to compile your own mobile app for that:  
[https://docs.rocket.chat/guides/mobile-guides/push-notifications#self-configured](https://docs.rocket.chat/guides/mobile-guides/push-notifications#self-configured)

---

<div class="post-metadata">

**Author:** ![klonni](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/klonni/32/2309_2.png) [@klonni](https://forums.rocket.chat/u/klonni)\
**Post date:** [March 3, 2022, 11:54am UTC](https://forums.rocket.chat/t/notification-gateway-api/13463/3 "2022-03-03T11:54:39Z")

</div>

I already saw it. I wanna build my own mobile app that can work with multiple servers,  
so i cant use direct notification sender built in server and i cant use rocketchat gateway.  
I need to create my own gateway but i dont know how to do that because  
source code of gateway is not opensourced and api is not documented.

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [March 3, 2022, 12:01pm UTC](https://forums.rocket.chat/t/notification-gateway-api/13463/4 "2022-03-03T12:01:42Z")

</div>

One thing you can to is define the gateway api in Rocket.Chat to your own app, and from there relay those payloads for your own gateways.

Also, you are welcome to join our dev channels, where other developers with more knowledge on this may be able to help you better then I can 🙂

> **[Rocket.Chat](https://open.rocket.chat/channel/dev)**

> **[Rocket.Chat](https://open.rocket.chat/channel/react-native)**

---

<div class="post-metadata">

**Author:** ![klonni](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/klonni/32/2309_2.png) [@klonni](https://forums.rocket.chat/u/klonni)\
**Post date:** [March 3, 2022, 12:37pm UTC](https://forums.rocket.chat/t/notification-gateway-api/13463/5 "2022-03-03T12:37:06Z")

</div>

I dont want to change server code, just want to create gateway that fits current api.

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [March 3, 2022, 1:57pm UTC](https://forums.rocket.chat/t/notification-gateway-api/13463/6 "2022-03-03T13:57:04Z")

</div>

I mean changing in Admin \> Push \> Gateway.

So instead of sending to our gateway, it will send to yours gateway (a custom one you will need to build), you then relay it to the Notification Services with the corresponding keys built into your whitelabel mobile app.

Again, I am not an expert on Notifications, so not sure this is a possible or best approach for that.

---

<div class="post-metadata">

**Author:** ![bradley.hilton](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/bradley.hilton/32/30_2.png) [@bradley.hilton](https://forums.rocket.chat/u/bradley.hilton)\
**Post date:** [March 3, 2022, 4:08pm UTC](https://forums.rocket.chat/t/notification-gateway-api/13463/7 "2022-03-03T16:08:44Z")

</div>

As @dudanogueira mentioned, you will have to build your own and work with what Rocket.Chat sends. If you are looking for a step-by-step guide on how to do that, we do not have that since we encourage our users to use our gateway. You will have to do R&D yourself by inspecting the payloads, figuring out how to integrate with Apple and Google and then getting the push notifications to apps. The last part has already been linked, so that’s a huge chunk of R&D out of the way already.

---

<div class="post-metadata">

**Author:** ![sareerkhan](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sareerkhan](https://forums.rocket.chat/u/sareerkhan)\
**Post date:** [August 21, 2023, 12:25pm UTC](https://forums.rocket.chat/t/notification-gateway-api/13463/8 "2023-08-21T12:25:07Z")

</div>

i am trying to inspect payload but this is what happened

```auto
{"level":40,"time":"2023-08-21T10:38:33.284Z","pid":25013,"hostname":"chat","name":"Push","msg":"Error sending push to gateway (not authorized) '{\"detail\":\"Given token not valid for any token type\",\"code\":\"token_not_valid\",\"messages\":[{\"token_class\":\"AccessToken\",\"token_type\":\"access\",\"message\":\"Token is invalid or expired\"}]}'"} 

```

---

<div class="post-metadata">

**Author:** ![sareerkhan](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sareerkhan](https://forums.rocket.chat/u/sareerkhan)\
**Post date:** [August 22, 2023, 8:30am UTC](https://forums.rocket.chat/t/notification-gateway-api/13463/9 "2023-08-22T08:30:26Z")

</div>

Did you find a way to create your own gateway

i think it need soome access token in return but not sure what it actually wants. currently when i want to print the payload of the gateway i receive this

```auto
{"level":40,"time":"2023-08-21T10:38:33.284Z","pid":25013,"hostname":"chat","name":"Push","msg":"Error sending push to gateway (not authorized) '{\"detail\":\"Given token not valid for any token type\",\"code\":\"token_not_valid\",\"messages\":[{\"token_class\":\"AccessToken\",\"token_type\":\"access\",\"message\":\"Token is invalid or expired\"}]}'"} 

```
