@@ -432,7 +432,117 @@ paths:
432432 - mid : " 7"
433433 sessionId : " 2a45361d5fd7cc14eface0587c276c94"
434434 trackName : " new-track-name"
435-
435+ /apps/{appId}/sessions/{sessionId}/datachannels/new :
436+ post :
437+ tags :
438+ - Add data channel(s)
439+ summary : Solve the given data channel object(s) and add the data channel(s) to the WebRTC session
440+ requestBody :
441+ content :
442+ application/json :
443+ schema :
444+ $ref : " #/components/schemas/DataChannelsRequest"
445+ examples :
446+ local_datachannels :
447+ description : Share a data channel to be consumed by remote peers
448+ value :
449+ datachannels :
450+ - location : local
451+ dataChannelName : 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
452+ remote_datachannels :
453+ description : Consume a remote data channel
454+ value :
455+ datachannels :
456+ - location : remote
457+ sessionId : " 2a45361d5fd7cc14eface0587c276c94"
458+ dataChannelName : 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
459+ security :
460+ - secret : []
461+ parameters :
462+ - in : path
463+ name : appId
464+ schema :
465+ type : string
466+ required : true
467+ description : WebRTC application ID
468+ - in : path
469+ name : sessionId
470+ schema :
471+ type : string
472+ required : true
473+ description : Current PeerConnection session ID
474+ responses :
475+ " 200 " :
476+ description : OK
477+ headers :
478+ vary :
479+ schema :
480+ type : string
481+ example : Origin
482+ content :
483+ application/json :
484+ schema :
485+ $ref : " #/components/schemas/DataChannelsResponse"
486+ examples :
487+ local_datachannels :
488+ value :
489+ datachannels :
490+ - dataChannelName : 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
491+ location : local
492+ id : 3
493+ remote_datachannels :
494+ value :
495+ datachannels :
496+ - sessionId : 2a45361d5fd7cc14eface0587c276c94
497+ location : remote
498+ dataChannelName : 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
499+ id : 4
500+ /apps/{appId}/sessions/{sessionId}/datachannels/close :
501+ put :
502+ tags :
503+ - Close data channel(s)
504+ summary : Close local or remote data channel(s)
505+ requestBody :
506+ content :
507+ application/json :
508+ schema :
509+ allOf :
510+ - $ref : " #/components/schemas/CloseDataChannelsRequest"
511+ - example :
512+ datachannels :
513+ - id : 2
514+ security :
515+ - secret : []
516+ parameters :
517+ - in : path
518+ name : appId
519+ schema :
520+ type : string
521+ required : true
522+ description : WebRTC application ID
523+ - in : path
524+ name : sessionId
525+ schema :
526+ type : string
527+ required : true
528+ responses :
529+ " 200 " :
530+ description : OK
531+ headers :
532+ vary :
533+ schema :
534+ type : string
535+ example : Origin
536+ content :
537+ application/json :
538+ schema :
539+ $ref : " #/components/schemas/CloseDataChannelsResponse"
540+ example :
541+ datachannels :
542+ - location : remote
543+ sessionId : 2a45361d5fd7cc14eface0587c276c94
544+ dataChannelName : 1a037563-c35c-4bf6-a9ee-2b474cbb9a51
545+ id : 2
436546 /apps/{appId}/sessions/{sessionId} :
437547 get :
438548 tags :
@@ -709,3 +819,69 @@ components:
709819 errorDescription :
710820 type : string
711821 description : Array of track objects with results
822+ DataChannelObject :
823+ type : object
824+ properties :
825+ location :
826+ type : string
827+ enum :
828+ - local
829+ - remote
830+ description : Choose local to broadcast into the given dataChannelName. Choose remote to consume a broadcast from someone else
831+ sessionId :
832+ type : string
833+ description : Session ID of the data channel owner. It should be set for remote data channels only
834+ dataChannelName :
835+ type : string
836+ description : Given name for the data channel
837+ id :
838+ type : number
839+ description : Data channel id
840+ DataChannelsRequest :
841+ type : object
842+ properties :
843+ dataChannels :
844+ type : array
845+ items :
846+ $ref : " #/components/schemas/DataChannelObject"
847+ DataChannelsResponse :
848+ type : object
849+ properties :
850+ errorCode :
851+ type : string
852+ errorDescription :
853+ type : string
854+ dataChannels :
855+ type : array
856+ items :
857+ allOf :
858+ - $ref : " #/components/schemas/DataChannelObject"
859+ - properties :
860+ errorCode :
861+ type : string
862+ errorDescription :
863+ type : string
864+ CloseDataChannelsRequest :
865+ type : object
866+ properties :
867+ dataChannels :
868+ type : array
869+ items :
870+ $ref : " #/components/schemas/CloseTrackObject"
871+ CloseDataChannelsResponse :
872+ type : object
873+ properties :
874+ errorCode :
875+ type : string
876+ errorDescription :
877+ type : string
878+ dataChannels :
879+ type : array
880+ items :
881+ allOf :
882+ - $ref : " #/components/schemas/DataChannelObject"
883+ - properties :
884+ errorCode :
885+ type : string
886+ errorDescription :
887+ type : string
0 commit comments