Creating an Open Channel not letting me set the channel URL

I am attempting to use the Javascript SDK in my React app to create an open channel.

const params: SendBird.OpenChannelParams = new sdk.OpenChannelParams();
params.name = channelId;
params.data = JSON.stringify({
  shipmentId: channelId,
});
params.channelUrl = channelId;
sdk.OpenChannel.createChannel(params, (openChannel) => {
  ...
});

I’m using params.channelUrl to set a unique URL, as per the docs, but in the POST the channelUrl is never used. The POST body to /v3/open_channels only uses the name, data, and operators keys.

Is there something I’m doing wrong here?

UPDATE:

I don’t see channelUrl being used in the minified Sendbird.min.js code for creating an OpenChannel:

{
            key: "createChannel",
            value: function() {
                var i = this
                  , n = W.toArray(arguments)
                  , e = null;
                "function" == typeof n[n.length - 1] && (e = n.pop());
                var t = B.get(this._iid)
                  , r = t.OpenChannel
                  , t = t.OpenChannelParams;
                if (n[0]instanceof t && 1 === n.length)
                    return ae(this._iid, function(r) {
                        var e = n[0];
                        e._validate() ? ce.get(i._iid).container.apiClient.createOpenChannel(e, function(e, n) {
                            var t = null;
                            e || (t = B.get(i._iid).OpenChannel.upsert(n)),
                            r(e, t)
                        }) : r(W.error, null)
                    }, e);
                var a = new t;
                switch (n.length) {
                case 0:
                    break;
                case 1:
                    a.name = n[0];
                    break;
                case 2:
                    a.name = n[0],
                    a.coverUrlOrImage = n[1];
                    break;
                case 3:
                    a.name = n[0],
                    a.coverUrlOrImage = n[1],
                    a.data = n[2];
                    break;
                case 4:
                    a.name = n[0],
                    a.coverUrlOrImage = n[1],
                    a.data = n[2],
                    a.operatorUserIds = n[3];
                    break;
                case 5:
                    a.name = n[0],
                    a.coverUrlOrImage = n[1],
                    a.data = n[2],
                    a.operatorUserIds = n[3],
                    a.customType = n[4];
                    break;
                default:
                    return ae(this._iid, function(e) {
                        return e(W.error, null)
                    }, e)
                }
                return e ? r.createChannel(a, e) : r.createChannel(a)
            }

If you look at the switch/case statement, channelUrl is missing.

Hi @mwq27,

Looks like you are correct, that it appears to be missing. Let me work with our Engineering team to validate.

1 Like

Thanks Tyler,

Do you know if this bug has been confirmed, and if a patch is coming soon?

Hi @mwq27,

I’ve heard anything back on this yet. As soon as I hear something, I’ll make sure to pass it your way.

-Tyler