According to the Platform API docs I can’t pass the channel URL and it is auto generated. In the app I am working on, we are using the javascript sdk for our react-native app and then the platform API for our backend. Generally the javascript sdk does all the work, but I need to replicate that functionality in python for a certain use case.
The javascript sdk Ticket creation looks like this:
SendBirdDesk.Ticket.create(
channelUrl, // ticket_title
userId, // user_id
teamKey, // team_key
{ channel: channelUrl, team: teamKey }, // custom fields
null, // priority
(ticket, err) => {})
Long story short, we’re doing some internal tracking of the channel URL and so we’re passing it as the custom field and the ticket title.
In the Sendbird Desk dashboard all of our javascript initiated tickets have the channel URL specified above in the custom fields + ticket title. What is actually setting the channel_url when we do it that way? And how can I duplicate that functionality with the Desk API?
Hi @bredelman. As far as I understood, you are creating a channel first, after you get the channel URL, you will update the ticket’s title and custom fields with the channel URL. right?
But, could you clarify the following question one more time, please?
- What is actually setting the channel_url when we do it that way?
- How can I duplicate that functionality with the Desk API?
Hey @sardorbek.numonov no we are creating the Ticket first and using the ticket.channel to chat, etc. So we are creating the ticket as described above and the channel URL seems to be set by either the ticket_title or the custom field. We have a variable, channelUrl, which we’ve predetermined how we want our channels to be named. We have tickets that have been generated with the above code that also have the actual channel_url set to the channelUrl variable we are passing. The confusing part is that we are passing the ticket_title and the custom fields, and the channel_url seems to be auto generated as the exact value of our channelUrl variable. Does that make sense?
So this is desired behavior for us, however it is happening. I would like to understand why the channel_url is being set that way better so that I can better recreate this logic using the Desk API endpoints. Basically the documentation says that I can’t set the channel URL for either one, but it seems to be happening for the javascript SDK. I haven’t gotten deep enough to know that is the case or not with the Desk API, but knowing how that channel URL is being set will be helpful.
Sorry I think I see where I am confused. In the desk dashboard there is a spot for ticket fields which I wasn’t really registering as the custom fields. Upon further API inspection the channel URL is not set by me at all and is an auto-generated value different than what I thought it was.
Would it be possible to manually set the channel URL via the desk API and the javascript sdk?
Sorry for the late response. I checked with Desk Engineers. Seems that currently, the name of the channel URL is created automatically, now. The customer can not set the name.