team-telnyx / telnyx-node

Node SDK for the Telnyx API
https://developers.telnyx.com/docs/api/v2/overview
MIT License
51 stars 20 forks source link

Example of joining a conference without first creating a conference or making an API call? #70

Closed bxjx closed 3 years ago

bxjx commented 3 years ago

Hello! The documentation you have seems to require that you create a conference in order to get a response that then can be used to call methods on the nest resource.

E.g. From https://developers.telnyx.com/docs/api/v2/call-control/Conference-Commands?lang=node#conferenceJoin

const { data: conference } = await telnyx.conferences.create({ call_control_id: 'uuid', name: 'Business' });
conference.join();

Is there an easy way to join a conference without first making an API call? Internally I see that you have a addResourceToResponseData method that takes response data and then creates a resource with nested methods. Could I use that or am I totally missing something and there is an easier way?

Thanks!

bxjx commented 3 years ago

Resolved! You can build the instance with something like const call = telnyx.Call({ call_control_id });.