# Sending Notification to Specific User with Onesignal

**URL:** <https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022>\
**Category:** Tutorials and DIY Guides\
**Tags:** community, push-notifications, onesignal, webapi, expert, tutorial\
**Created:** [July 21, 2019, 12:58am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022 "2019-07-21T00:58:23Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![harekrishnamovement](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@harekrishnamovement](https://community.thunkable.com/u/harekrishnamovement)\
**Post date:** [February 26, 2020, 10:15am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/24 "2020-02-26T10:15:15Z")

</div>

There was a problem in the JSON you submitted: unexpected character at line 1, column 3 it is saying.

I am not able to get what exactly is the problem in this.

Can someone help me please

---

<div class="post-metadata">

**Author:** ![harekrishnamovement](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@harekrishnamovement](https://community.thunkable.com/u/harekrishnamovement)\
**Post date:** [February 26, 2020, 11:34am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/25 "2020-02-26T11:34:38Z")

</div>

{“app\_id”: “b230cf39-782f-41d8-b99f-2df930fd6ca6",  
“contents”: {“en”: “HKP this is the test message”},  
“headings”: {“en”: “HKGT Internal"},  
“url”: “”,  
“include\_player\_ids”: [“20351ae5-310c-4af5-931b-1f4330dd4331"]}

The above is in BODY. I am not able to figure out why it is giving that error

Please help

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [February 26, 2020, 2:07pm UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/26 "2020-02-26T14:07:58Z")

</div>

The url property is blank, do you need that?

---

<div class="post-metadata">

**Author:** ![harekrishnamovement](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@harekrishnamovement](https://community.thunkable.com/u/harekrishnamovement)\
**Post date:** [February 26, 2020, 2:12pm UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/27 "2020-02-26T14:12:37Z")

</div>

I don’t need that

---

<div class="post-metadata">

**Author:** ![harekrishnamovement](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@harekrishnamovement](https://community.thunkable.com/u/harekrishnamovement)\
**Post date:** [February 26, 2020, 2:13pm UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/28 "2020-02-26T14:13:23Z")

</div>

But I tried it by removing that also. Same error is coming.

Even I tried removing contents and headings also.

Same error is coming

---

<div class="post-metadata">

**Author:** ![harekrishnamovement](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@harekrishnamovement](https://community.thunkable.com/u/harekrishnamovement)\
**Post date:** [February 26, 2020, 3:09pm UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/29 "2020-02-26T15:09:25Z")

</div>

Finally it is working. I just moved app\_id to query parameters and shifted include\_player\_ids to front. I didn’t know the reason but it worked

But in the popup if I click OK it is going to somewhere. Although I have not given anything in URL

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [February 26, 2020, 3:22pm UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/30 "2020-02-26T15:22:07Z")

</div>

> [@bymaho](#):
>
> {  
> “app\_id”: “05a1a9c5-xxxx-xxxx-xxxxx-aad3xx5071f2”,  
> “include\_player\_ids”: [“8c08f556-xxxx-xxxx-xxxx-2513x6x64x51”],  
> “data”: {“foo”: “bar”},  
> “contents”: {“en”: “English Message”}

This is the code that @bymaho posted above. I notice yours is different. Do you think that may be what’s causing your issues?

---

<div class="post-metadata">

**Author:** ![newb2apps](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@newb2apps](https://community.thunkable.com/u/newb2apps)\
**Post date:** [March 4, 2020, 4:53am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/31 "2020-03-04T04:53:20Z")

</div>

Hi All,

I am going through all these responses and I can set up for sending to a single user based upon an event. However, I have some further specific needs:

Imagine a news app which sends push notifications of specific stories based upon a users interests that they select when registering for the app. So, my questions would be:

1. OneSignal has a segmentation option based upon User Tags that are inserted in the app. Is it possible for me to use this so that I can group segments of the user base together to customize the notifications different groups would receive?

2. Assuming #1 is possible, then if a user clicks on the notification, how can I create the link between the OneSignal notification and a specific app page?

Thanks

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 4, 2020, 4:59am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/32 "2020-03-04T04:59:39Z")

</div>

I don’t have the answer to your question, but you should post on how to send a push message based upon an in-app event! That sounds really cool!

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://community.thunkable.com/u/jacob1)\
**Post date:** [March 4, 2020, 5:11am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/33 "2020-03-04T05:11:18Z")

</div>

You can segment notifications either using the segment parameter or tag parameter you can see more here [https://documentation.onesignal.com/reference#create-notification](https://documentation.onesignal.com/reference#create-notification)

However the answer to your second question. I haven’t found a way to provide deep links to the url in the app. Would be keen to see if the thunkable team know how this is done

@jared this is entirely possible to activate a notification from an in app event you can also use one signals api to delay a notification.

For example I use this to allow my users to submit a support ticket to another user, and they set a validity on the support ticket which I use to delay another notification which sends to them the day before the ticket expires to provide follow up. It’s useful

---

<div class="post-metadata">

**Author:** ![newb2apps](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@newb2apps](https://community.thunkable.com/u/newb2apps)\
**Post date:** [March 4, 2020, 5:51am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/34 "2020-03-04T05:51:10Z")

</div>

@jacob1, I can see the documentation provided by OneSignal. However, I am curious of taking this a step further.

For the news app analogy (not what I am trying to make, but easy to use for explaining intent), imagine a set of preference selections in which I could select topics of interest. So these selections would then be stored in Firebase (appearing as True of False).

So I would then want to be able to send important news alert to a user that selected interest in a particular topic, but not to those that did not select this. I can easily add another layer to Firebase that marks users as A, B, C, D, etc. based upon their selections. But what I stumble on is how to use this same segmentation in OneSignal.

Any thoughts on how to do this?

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://community.thunkable.com/u/jacob1)\
**Post date:** [March 4, 2020, 6:17am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/35 "2020-03-04T06:17:29Z")

</div>

I think this would be possible, I would complete it as below…

Set the parent nodes as preference topics so your path in firebase would look something like:

Users Topic Preferences \> Topic Example Name \> Users Push ID

1. When user marks their preference save their Push ID under the parent node for that topic in firebase

2. Then use a Web API component with a POST request send that to one signal api and use the “tag” parameter against this user. This could be the same as your parent node topic preference name.

3. Whenever a user marks their preference in the app it will add an additional tag to them In onesignal so you can filter the messages.

PM me if you need a hand

---

<div class="post-metadata">

**Author:** ![newb2apps](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@newb2apps](https://community.thunkable.com/u/newb2apps)\
**Post date:** [March 8, 2020, 5:07am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/36 "2020-03-08T05:07:13Z")

</div>

All,

Just letting everyone here know I found a solution to my earlier post on this topic regarding putting tags into OneSignal so that you can create segments for sending push notifications.

Using Gender selection as an example, the block looks like this:

 ![Screenshot - WebAPI block_solution](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/6/e65fb47accf61ab2bb62033ef5eb464d097ea3c7.png)

Hope this helps others that may encounter the same issue that I did.

Best,  
K

---

<div class="post-metadata">

**Author:** ![mom7667yafy](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mom7667yafy](https://community.thunkable.com/u/mom7667yafy)\
**Post date:** [April 16, 2020, 10:12am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/37 "2020-04-16T10:12:03Z")

</div>

[https://x.thunkable.com/copy/1ea79eed4bb6f90ad849b9c6cddae14d](https://x.thunkable.com/copy/1ea79eed4bb6f90ad849b9c6cddae14d)

 ![20200416_184822](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/2/825bec83df7e70a571409ef545e611247f14bc78.jpeg)

I tried to do as you told me.  
But it doesn’t work.  
What is wrong?

I would have forgotten something and entered something wrong.  
Please let me know how.

Linked the file I tried.  
I would appreciate it if you could.

---

<div class="post-metadata">

**Author:** ![mom7667yafy](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mom7667yafy](https://community.thunkable.com/u/mom7667yafy)\
**Post date:** [April 16, 2020, 10:33am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/38 "2020-04-16T10:33:50Z")

</div>

I don’t understand explanation 3.  
I would be grateful if you could suggest the block coding for the 3rd explanation.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 16, 2020, 11:54am UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/39 "2020-04-16T11:54:55Z")

</div>

You set the body but did you initiate the push/get command?

---

<div class="post-metadata">

**Author:** ![mom7667yafy](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mom7667yafy](https://community.thunkable.com/u/mom7667yafy)\
**Post date:** [April 16, 2020, 12:01pm UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/40 "2020-04-16T12:01:36Z")

</div>

I am a complete beginner.  
I have never used api.

I just have to follow the tutorial and do the same.

I would be really grateful if you could give me a full block coding example, including the ones I didn’t do.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 16, 2020, 12:14pm UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/41 "2020-04-16T12:14:51Z")

</div>

Do the tutorials on YouTube. There are multiple.

Have you done those yet. There 3-5 different tutorials

---

<div class="post-metadata">

**Author:** ![mom7667yafy](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mom7667yafy](https://community.thunkable.com/u/mom7667yafy)\
**Post date:** [April 16, 2020, 12:19pm UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/42 "2020-04-16T12:19:41Z")

</div>

I searched all youtube lectures.  
However, nothing like this is covered in detail.  
It couldn’t fill my shortage.

What youtube handles push / get command?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 16, 2020, 12:23pm UTC](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/43 "2020-04-16T12:23:42Z")

</div>

Each one would use at least one of them.

The problem is what you want isn’t necessarily easy.

You can’t build a house with a toy hammer. You have to learn how to use the adult hammer.

Thunkable makes many things easy. But somethings are intermediate and require lots of trial and error.

I think a Clean tutorial for just this would be cool. I may try to tackle this sometime this week or next!

[Previous page](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022.md?page=1)

[Next page](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022.md?page=3)
