Create a new participant under this account
Participants are idempotent, so relevant parameters must be set in this function if desired
Request URL
POST
https://api.webrtc.bandwidth.com/v1/accounts/{accountId}/participants
Basic Authentication
Bandwidth WebRTC API leverages Basic Authentication with your Dashboard API Credentials. Read more about how Bandwidth secures endpoints in the Security & Credentials document.
Request Body Parameters
Parameter | Description |
---|---|
callbackUrl | Full callback url to use for notifications about this participant |
publishPermissions | Defines the types of media this participant can publish. Accepted values: AUDIO ,VIDEO |
tag | User defined tag to associate with the participant |
Response Attributes
Property | Description |
---|---|
participant | A participant object |
token | Auth token for the returned participant |
Example: Create a new participant under this account
curl -X POST
--url 'https://api.webrtc.bandwidth.com/v1/accounts/{accountId}/participants'
-u '{username}:{password}'
-H 'Content-type: application/json'
--data-raw '
{
"callbackUrl": "https://example.com/callback",
"publishPermissions": [
"VIDEO",
"AUDIO"
],
"tag": "participant1"
}'
Responds
{
"participant" : {
"id" : "320e2af6-13ec-498d-8b51-daba52c37853",
"callbackUrl" : "https://example.com/callback",
"publishPermissions" : [
"VIDEO",
"AUDIO"
],
"sessions" : [
"75c21163-e110-41bc-bd76-1bb428ec85d5"
],
"subscriptions" : {
"sessionId" : "d8886aad-b956-4e1b-b2f4-d7c9f8162772",
"participants" : [
{
"participantId" : "568749d5-04d5-483d-adf5-deac7dd3d521"
},
{
"participantId" : "0275e47f-dd21-4cf0-a1e1-dfdc719e73a7"
}
]
},
"tag" : "participant1"
},
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiaWF0IjoxNTE2MjM5MDIyfQ.L8i6g3PfcHlioHCCPURC9pmXT7gdJpx3kOoyAfNUwCc"
}
Potential Error Responses
HTTP/1.1 400 (Bad Request)
Content-Type: application/json
HTTP/1.1 401 (Unauthorized)
Content-Type: application/json
HTTP/1.1 403 (Access Denied)
Content-Type: application/json
HTTP/1.1 50x (Unexpected Error)
Content-Type: application/json