Reputation: 10781
In the Twilio documentation for the REST API for Media Streams, it says the Media Stream can be stopped with a name, but I can't quite figure out how or am I reading to much into the documentation.
Is it possible that the documentation is only relevant when using TwiML to stop the Media Stream and not the API and thus you have have use the Media Stream SID for the API?
<Stop>
<Stream name="my_first_stream" />
</Stop>
The example code in the docs is using the Media Steam SID only:
Stop Media Stream - Example in docs:
client.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.streams('MZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
.update({status: 'stopped'})
.then(stream => console.log(stream.name));
Upvotes: 0
Views: 564
Reputation: 11
Works the same for interacting with Conference resource friendly names; use the resource URL; e.g.
Where {{stream_name}} is the, well, stream name.
Upvotes: 1
Reputation: 73065
I am sure I have seen other APIs that allow you to specify a name or a SID when referring to the resource but I cannot find an example (so maybe I'm wrong).
This is a bit ambiguous here though. But, comments in the Node library suggest you can use a name or sid when constructing a stream:
@param {sid_like} sid - The SID of the Stream resource, or the `name`
And since those comments are derived from the API definitions, I believe that you can use the name in a REST API call too.
Upvotes: 0