# Send message outside Mathematica through Channel-Based Network?

**URL:** <https://community.wolfram.com/t/send-message-outside-mathematica-through-channel-based-network/9964>\
**Category:** Questions\
**Tags:** signal-processing, mathematica, external-interfaces, interface-construction, raspberry-pi, connected-devices\
**Created:** [February 2, 2017, 3:12pm UTC](https://community.wolfram.com/t/send-message-outside-mathematica-through-channel-based-network/9964 "2017-02-02T15:12:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dzviovich](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dzviovich/32/27395_2.png) [@dzviovich](https://community.wolfram.com/u/dzviovich)\
**Post date:** [February 2, 2017, 3:12pm UTC](https://community.wolfram.com/t/send-message-outside-mathematica-through-channel-based-network/9964/1 "2017-02-02T15:12:13Z")

</div>

Channel-Based communication is available since release 11.0 as an experimental functionality for publish-subscribe communication between WL sessions or with external systems.

Functionality works well between WL sessions, but when trying to send messages through external systems, I was unable to make this work.,

```
myChannel = CreateChannel["demo", Permissions -> "Public"]
(*ChannelObject["https://channelbroker.wolframcloud.com/users/user@example.com/demo"]*)

listener = ChannelListen[myChannel];
Dynamic[listener["Message"]]

ChannelSend[myChannel, <|key -> "test"|>]
(*Message Successful*)

Prepare command for curl (or web browser)
url = URLBuild[listener["URL"], {"operation" -> "send", "Message" -> "yet another message"}]

(*"https://channelbroker.wolframcloud.com/users/user%40example.com/demo?operation=send&Message=another+message"*)

(*Sending Message through the Mathematica Session works*)
URLExecute[url]
(*message ID*)

```

When trying through terminal with curl URL, or through the web browser, or other languages in the same computer, or another device, the following message is displayed:

**403 Forbidden**

Please, can you test this on your system to see if the same issue is found in your computer system?

Mathematica version 11.x

---

<div class="post-metadata">

**Author:** ![ijohnson](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/ijohnson/32/21468_2.png) [@ijohnson](https://community.wolfram.com/u/ijohnson)\
**Post date:** [February 2, 2017, 3:15pm UTC](https://community.wolfram.com/t/send-message-outside-mathematica-through-channel-based-network/9964/2 "2017-02-02T15:15:07Z")

</div>

Hi Diego,

What are the permissions of the channel you are trying to send? To send a message through say a web browser, or other HTTP client, the channel needs to be publically writable, with `Permissions-><|"All"->"Write",...|>`

Let me know if that works for you, but note that doing this will let anyone send any message on your channel.

Thanks,

Ian

---

<div class="post-metadata">

**Author:** ![dzviovich](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dzviovich/32/27395_2.png) [@dzviovich](https://community.wolfram.com/u/dzviovich)\
**Post date:** [February 2, 2017, 9:12pm UTC](https://community.wolfram.com/t/send-message-outside-mathematica-through-channel-based-network/9964/3 "2017-02-02T21:12:41Z")

</div>

Ian, this is are the options of the channel

```
<|ChannelPreSendFunction -> Automatic, HandlerFunctions -> None, 
 Initialization -> Automatic, 
 MetaInformation -> <|"OwnerID" -> "users@example.com"|>, 
 NotificationFunction -> Inherited, 
 Permissions -> <|All -> {"Write", "Read"}, 
   "user@example.com" -> "Execute"|>, 
 ChannelBase -> "https://channelbroker.wolframcloud.com:443", 
 "URLRendering" -> Automatic|>

```

---

<div class="post-metadata">

**Author:** ![dzviovich](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dzviovich/32/27395_2.png) [@dzviovich](https://community.wolfram.com/u/dzviovich)\
**Post date:** [February 2, 2017, 11:36pm UTC](https://community.wolfram.com/t/send-message-outside-mathematica-through-channel-based-network/9964/4 "2017-02-02T23:36:46Z")

</div>

Hi Ian, the permissions read,

Permissions → \<|All → {“Write”, “Read”},  
“[myemail@gmail.com](mailto:myemail@gmail.com)” → “Execute”|\>

---

<div class="post-metadata">

**Author:** ![bakshee](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/bakshee/32/29900_2.png) [@bakshee](https://community.wolfram.com/u/bakshee)\
**Post date:** [February 4, 2017, 10:07am UTC](https://community.wolfram.com/t/send-message-outside-mathematica-through-channel-based-network/9964/5 "2017-02-04T10:07:05Z")

</div>

When copying a URL to external programs, make sure that you are using `Edit > Copy As > Plain Text` (Cmnd-Shift-C on Mac)… or otherwise remove the line continuation characters (“`\`”) that the Front End inserts in the copied text.

As yet another trick, you can execute:

```
Hyperlink[url]

```

… and then click the output link. That will use the correct URL in your default web browser.
