Reputation: 1177
I am having trouble creating a Conference Participant using the ReST API in twilio. The following is my request:
participant = ParticipantResource.Create(
new CreateParticipantOptions(
"conferenceName",
new PhoneNumber("client:791ecf-263c-49eb-9b9b-b6a265ee28d8"),
new PhoneNumber("client:59191ecf-263c-49eb-9b9b-b6a265ee28d8?agentFirstName=Michael&agentLastName=Scott++"))
{
Beep = Conference.BeepEnum.True.ToString(),
EndConferenceOnExit = true,
ConferenceStatusCallback = new Uri(statusCallbackUrl),
ConferenceStatusCallbackMethod = HttpMethod.Post,
ConferenceStatusCallbackEvent = new List<string>()
{
Conference.EventEnum.Start.ToString(),
Conference.EventEnum.Join.ToString(),
Conference.EventEnum.Leave.ToString(),
Conference.EventEnum.End.ToString()
}
}
);
I believe this is the correct way to invoke this method to create a participant. I want to dial from agent 1 to agent 2, in order to get agent 2 into the conference call.
The conference call, create participant reference that I have followed is: https://www.twilio.com/docs/voice/api/conference-participant-resource
I want to pass the custom parameters to agent 2 who is logged in from the web client, in order to show agent 2 who is calling him.
Upvotes: 1
Views: 277
Reputation: 1177
The code implementation was correct, however you cannot provide client names with hypens "-". Although this works when returning TwiML via a callback URL, it doesn't work via the ReST API.
param1=Hello¶m2=¶m3=World
here param 2 is empty.An example of a correct client reference would be
new PhoneNumber("client:59191ecf_263c_49eb_9b9b_b6a265ee28d8?agentFirstName=Michael&agentLastName=Scott"))
p.s. Make sure your capability token is also created with the client id without hyphens.
Upvotes: 1