# Looking for a Platform API Text Chat Example

**URL:** https://community.sendbird.com/t/looking-for-a-platform-api-text-chat-example/4744
**Category:** API
**Tags:** platform, js, 1:1-chat
**Created:** [May 26, 2022, 1:29am UTC](https://community.sendbird.com/t/looking-for-a-platform-api-text-chat-example/4744 "2022-05-26T01:29:24Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![scottpatrickwright](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/scottpatrickwright/32/4728_2.png) [@scottpatrickwright](https://community.sendbird.com/u/scottpatrickwright)
#### Post date: [May 26, 2022, 1:29am UTC](https://community.sendbird.com/t/looking-for-a-platform-api-text-chat-example/4744/1 "2022-05-26T01:29:25Z")

</div>

Hi, I am working on an application where the chat is integrated with our server side code. I am having difficulty finding examples of code using the Platform API. I have seen the docs but I would like to see some examples as the docs still leave somethings a little unclear. It would also be helpful to see a couple examples of how to approach problems.

Are there are any sample Platform API projects out there? Any other advice as to how to proceed?

---

<div class="post-metadata">

### Author: ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)
#### Post date: [May 26, 2022, 1:37am UTC](https://community.sendbird.com/t/looking-for-a-platform-api-text-chat-example/4744/3 "2022-05-26T01:37:40Z")

</div>

Hi @scottpatrickwright,

Welcome to the Sendbird Community. Can you expand on what kind of difficulty you’re having? The Platform API is pretty vast and thus it can cover a large variety of use cases.

In terms of implementation, The Platform API is purely an HTTP request and thus you can utilize it with your favorite libraries like Axios, Fetch, Got, etc.

Additionally, we just released an SDK for the Platform API for node. [sendbird-platform-sdk - npm](https://www.npmjs.com/package/sendbird-platform-sdk)

---

<div class="post-metadata">

### Author: ![scottpatrickwright](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/scottpatrickwright/32/4728_2.png) [@scottpatrickwright](https://community.sendbird.com/u/scottpatrickwright)
#### Post date: [May 26, 2022, 1:50am UTC](https://community.sendbird.com/t/looking-for-a-platform-api-text-chat-example/4744/4 "2022-05-26T01:50:44Z")

</div>

Thanks for the reply.

Well specifically we are looking to build an experience where the server can control on a message by message basis whether a user can send a message to a recipient. I can imagine how to get the work done in broad strokes but there can be missing details. I find examples clear up the gaps that most docs leave.

In this case I am wondering about the format of the channel url when sending a message:

```auto
POST https://api-{application_id}.sendbird.com/v3/{channel_type}/{channel_url}/messages

```

The docs say its a string and one assumes a URL. But it doesn’t seem to say much more about it. Is it an actual URL or just some unique string like a UUID? If its a URL - what should it be specifically?

---

<div class="post-metadata">

### Author: ![scottpatrickwright](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/scottpatrickwright/32/4728_2.png) [@scottpatrickwright](https://community.sendbird.com/u/scottpatrickwright)
#### Post date: [May 26, 2022, 1:51am UTC](https://community.sendbird.com/t/looking-for-a-platform-api-text-chat-example/4744/5 "2022-05-26T01:51:30Z")

</div>

> **[Send a message | Chat Platform API | Sendbird Docs](https://sendbird.com/docs/chat/v3/platform-api/message/messaging-basics/send-a-message)**
>
> You can use this action to send a text message, a file message, or an admin message to a specific channel. Sendbird Chat SDKs and the platform API allows you to upload any type of files in messages to the Sendbird server. See Message Overview for...

---

<div class="post-metadata">

### Author: ![scottpatrickwright](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/scottpatrickwright/32/4728_2.png) [@scottpatrickwright](https://community.sendbird.com/u/scottpatrickwright)
#### Post date: [May 26, 2022, 1:56am UTC](https://community.sendbird.com/t/looking-for-a-platform-api-text-chat-example/4744/6 "2022-05-26T01:56:27Z")

</div>

Ok had an idea while forming the question to you. I see that when I create a channel I either specify or get back a URL. So it would match that. I also see an example where the channel URL appears to be a string identifier essentially.

Here is the response you would get from creating a channel:

```auto
{
    "name": "Saturday soccer members",
    "channel_url": "private_chat_room_424",
    "cover_url": "https://sendbird.com/main/img/cover/cover_08.jpg",
    "custom_type": "sports",
    "is_distinct": true,
    "inviter_id": "Jay",
    "user_ids": ["Jay", "James", "Young"],
    "invitation_status": {
        "James": "invited_by_friend",
        "Young": "invited_by_non_friend"
    },
    "hidden_status": {
        "Jay": "hidden_allow_auto_unhide"
    },
    "operator_ids": ["Jeff"]
}

```

But I guess no sample project readily available then?

---

<div class="post-metadata">

### Author: ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)
#### Post date: [May 26, 2022, 3:19am UTC](https://community.sendbird.com/t/looking-for-a-platform-api-text-chat-example/4744/7 "2022-05-26T03:19:40Z")

</div>

Hi @scottpatrickwright,

Unfortunately, we don’t have any kind of sample projects around the the Platform API. The Platform API is more specifically for management purposes and isn’t how you should be sending messages to channels on behalf of users. That should be occurring via the SDKs so they can receive realtime updates.

---

<div class="post-metadata">

### Author: ![scottpatrickwright](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/scottpatrickwright/32/4728_2.png) [@scottpatrickwright](https://community.sendbird.com/u/scottpatrickwright)
#### Post date: [May 26, 2022, 4:32pm UTC](https://community.sendbird.com/t/looking-for-a-platform-api-text-chat-example/4744/8 "2022-05-26T16:32:28Z")

</div>

Does that mean that if I called the POST message endpoint on a user’s behalf the recipient would not have the message broadcast to them as I would normally expect if the message was sent from the client via the SDK?

---

<div class="post-metadata">

### Author: ![scottpatrickwright](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/scottpatrickwright/32/4728_2.png) [@scottpatrickwright](https://community.sendbird.com/u/scottpatrickwright)
#### Post date: [May 26, 2022, 4:37pm UTC](https://community.sendbird.com/t/looking-for-a-platform-api-text-chat-example/4744/9 "2022-05-26T16:37:55Z")

</div>

I’d like to tease out the differences between sending messages via the Platform API and via the client SDKs.

I recognize that this may not be a core expectation with the Platform API but our use case really does require that we can ‘gate’ message sending on a message by message basis.

---

<div class="post-metadata">

### Author: ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)
#### Post date: [May 26, 2022, 11:13pm UTC](https://community.sendbird.com/t/looking-for-a-platform-api-text-chat-example/4744/10 "2022-05-26T23:13:31Z")

</div>

If the user is connected to Sendbird via the SDK, they’ll still receive realtime updates that a message was sent to a channel they’re in.
