/live-streams api returns all videos, even deleted

Hello,

when using /live-streams api, I am getting 85 records, however, I have only 1 video as seen in my dashboard. I have done a lot of tests, however, I have deleted all of them, but one.

That’s all. That API returns all videos on purpose? is there a way to retrieve only videos that are not deleted?

I can filter by liveStreamId according to what I have in my local database, but I am just wondering :slightly_smiling_face:

Regards
Jaime

Hi Jaime,

I am seeing 86 live streams in your account in the Sandbox. I just successfully deleted livestreams in both production and in sandbox. Can you send me the request you are sending to the server?

In case you did not know - you can reuse livestreams - create once, and then stream to it multiple times. Here’s an example of how I used this to group videos:

Here’s a demo page:

Doug

Hello Doug,

I have just deleted all my videos from sandbox dashboard, so I have no videos now.

Now, I used RESTED client chrome extension and made a GET call to https://sandbox.api.video/live-streams?currentPage=1&pageSize=10.

After I included the Authorization header I sent the request and this was the result:

{"data":[{"liveStreamId":"li4VP9DPErc6XuaQAi6mytPa","createdAt":"2020-09-26T15:41:12+00:00","updatedAt":"2020-09-26T15:41:12+00:00","streamKey":"d7315c1e-a44d-4372-85f4-97e54b9759c9","name":"Prueba","record":false,"broadcasting":false,"assets":{"iframe":"\u003Ciframe src=\u0022https://embed.api.video/live/li4VP9DPErc6XuaQAi6mytPa\u0022 width=\u0022100%\u0022 height=\u0022100%\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 allowfullscreen=\u0022\u0022\u003E\u003C/iframe\u003E","player":"https://embed.api.video/live/li4VP9DPErc6XuaQAi6mytPa","hls":"https://live.api.video/li4VP9DPErc6XuaQAi6mytPa.m3u8","thumbnail":"https://cdn.api.video/live/li4VP9DPErc6XuaQAi6mytPa/thumbnail.jpg"}},{"liveStreamId":"li5Uk3J9rZWUgL4xyrt3WUQM","createdAt":"2020-09-26T15:42:16+00:00","updatedAt":"2020-09-26T15:42:16+00:00","streamKey":"12af60c5-51bc-4e79-a8f4-ee6649c5408b","name":"Prueba","record":false,"broadcasting":false,"assets":{"iframe":"\u003Ciframe src=\u0022https://embed.api.video/live/li5Uk3J9rZWUgL4xyrt3WUQM\u0022 width=\u0022100%\u0022 height=\u0022100%\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 allowfullscreen=\u0022\u0022\u003E\u003C/iframe\u003E","player":"https://embed.api.video/live/li5Uk3J9rZWUgL4xyrt3WUQM","hls":"https://live.api.video/li5Uk3J9rZWUgL4xyrt3WUQM.m3u8","thumbnail":"https://cdn.api.video/live/li5Uk3J9rZWUgL4xyrt3WUQM/thumbnail.jpg"}},{"liveStreamId":"li1jvLtbv2wRwsbN56zlnGfU","createdAt":"2020-09-26T18:10:39+00:00","updatedAt":"2020-09-26T18:10:39+00:00","streamKey":"f5b4f24c-923a-4572-93f9-61ca8c566c60","name":"Prueba","record":false,"broadcasting":false,"assets":{"iframe":"\u003Ciframe src=\u0022https://embed.api.video/live/li1jvLtbv2wRwsbN56zlnGfU\u0022 width=\u0022100%\u0022 height=\u0022100%\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 allowfullscreen=\u0022\u0022\u003E\u003C/iframe\u003E","player":"https://embed.api.video/live/li1jvLtbv2wRwsbN56zlnGfU","hls":"https://live.api.video/li1jvLtbv2wRwsbN56zlnGfU.m3u8","thumbnail":"https://cdn.api.video/live/li1jvLtbv2wRwsbN56zlnGfU/thumbnail.jpg"}},{"liveStreamId":"li3agkyZcbHDW4EJDfcOpQk0","createdAt":"2020-09-26T18:28:57+00:00","updatedAt":"2020-09-26T18:28:57+00:00","streamKey":"900613fb-c6f6-4195-a14c-704f65072875","name":"Prueba","record":false,"broadcasting":false,"assets":{"iframe":"\u003Ciframe src=\u0022https://embed.api.video/live/li3agkyZcbHDW4EJDfcOpQk0\u0022 width=\u0022100%\u0022 height=\u0022100%\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 allowfullscreen=\u0022\u0022\u003E\u003C/iframe\u003E","player":"https://embed.api.video/live/li3agkyZcbHDW4EJDfcOpQk0","hls":"https://live.api.video/li3agkyZcbHDW4EJDfcOpQk0.m3u8","thumbnail":"https://cdn.api.video/live/li3agkyZcbHDW4EJDfcOpQk0/thumbnail.jpg"}},{"liveStreamId":"li1P4JinnoebEm5zWLjGf4zI","createdAt":"2020-09-26T18:30:32+00:00","updatedAt":"2020-09-26T18:30:32+00:00","streamKey":"7f3323d0-dde8-4fbd-a463-8f7b93c86322","name":"Prueba","record":false,"broadcasting":false,"assets":{"iframe":"\u003Ciframe src=\u0022https://embed.api.video/live/li1P4JinnoebEm5zWLjGf4zI\u0022 width=\u0022100%\u0022 height=\u0022100%\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 allowfullscreen=\u0022\u0022\u003E\u003C/iframe\u003E","player":"https://embed.api.video/live/li1P4JinnoebEm5zWLjGf4zI","hls":"https://live.api.video/li1P4JinnoebEm5zWLjGf4zI.m3u8","thumbnail":"https://cdn.api.video/live/li1P4JinnoebEm5zWLjGf4zI/thumbnail.jpg"}},{"liveStreamId":"li5OjDlEkQUA5nylHIOSP0mX","createdAt":"2020-09-26T18:36:07+00:00","updatedAt":"2020-09-26T18:36:07+00:00","streamKey":"e50d552d-9c30-4c01-bd73-cf8619a2246d","name":"Prueba","record":false,"broadcasting":false,"assets":{"iframe":"\u003Ciframe src=\u0022https://embed.api.video/live/li5OjDlEkQUA5nylHIOSP0mX\u0022 width=\u0022100%\u0022 height=\u0022100%\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 allowfullscreen=\u0022\u0022\u003E\u003C/iframe\u003E","player":"https://embed.api.video/live/li5OjDlEkQUA5nylHIOSP0mX","hls":"https://live.api.video/li5OjDlEkQUA5nylHIOSP0mX.m3u8","thumbnail":"https://cdn.api.video/live/li5OjDlEkQUA5nylHIOSP0mX/thumbnail.jpg"}},{"liveStreamId":"li5sEfJF1jqJcgzIUbaGStNR","createdAt":"2020-09-26T18:49:40+00:00","updatedAt":"2020-09-26T18:49:40+00:00","streamKey":"dc0e3ffa-c2b7-4662-b323-db8ac277bfc6","name":"Prueba","record":false,"broadcasting":false,"assets":{"iframe":"\u003Ciframe src=\u0022https://embed.api.video/live/li5sEfJF1jqJcgzIUbaGStNR\u0022 width=\u0022100%\u0022 height=\u0022100%\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 allowfullscreen=\u0022\u0022\u003E\u003C/iframe\u003E","player":"https://embed.api.video/live/li5sEfJF1jqJcgzIUbaGStNR","hls":"https://live.api.video/li5sEfJF1jqJcgzIUbaGStNR.m3u8","thumbnail":"https://cdn.api.video/live/li5sEfJF1jqJcgzIUbaGStNR/thumbnail.jpg"}},{"liveStreamId":"li5EhLMzXtV2oievXqNHCYtR","createdAt":"2020-09-26T20:32:45+00:00","updatedAt":"2020-09-26T20:32:45+00:00","streamKey":"c5b6a87f-82a0-4174-aaaf-57bdc12ecae0","name":"Prueba","record":false,"broadcasting":false,"assets":{"iframe":"\u003Ciframe src=\u0022https://embed.api.video/live/li5EhLMzXtV2oievXqNHCYtR\u0022 width=\u0022100%\u0022 height=\u0022100%\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 allowfullscreen=\u0022\u0022\u003E\u003C/iframe\u003E","player":"https://embed.api.video/live/li5EhLMzXtV2oievXqNHCYtR","hls":"https://live.api.video/li5EhLMzXtV2oievXqNHCYtR.m3u8","thumbnail":"https://cdn.api.video/live/li5EhLMzXtV2oievXqNHCYtR/thumbnail.jpg"}},{"liveStreamId":"li3fPvdwhn4gXSH2xyDaGIw1","createdAt":"2020-09-26T20:52:19+00:00","updatedAt":"2020-09-26T20:52:19+00:00","streamKey":"da9be7db-aacf-47de-a132-ce387968cfbf","name":"Prueba","record":false,"broadcasting":false,"assets":{"iframe":"\u003Ciframe src=\u0022https://embed.api.video/live/li3fPvdwhn4gXSH2xyDaGIw1\u0022 width=\u0022100%\u0022 height=\u0022100%\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 allowfullscreen=\u0022\u0022\u003E\u003C/iframe\u003E","player":"https://embed.api.video/live/li3fPvdwhn4gXSH2xyDaGIw1","hls":"https://live.api.video/li3fPvdwhn4gXSH2xyDaGIw1.m3u8","thumbnail":"https://cdn.api.video/live/li3fPvdwhn4gXSH2xyDaGIw1/thumbnail.jpg"}},{"liveStreamId":"li5K1a3GJwEKhvTi4voUz2xz","createdAt":"2020-09-26T21:03:45+00:00","updatedAt":"2020-09-26T21:03:45+00:00","streamKey":"2f02b067-7a92-4460-a358-74c25f49d608","name":"Prueba","record":false,"broadcasting":false,"assets":{"iframe":"\u003Ciframe src=\u0022https://embed.api.video/live/li5K1a3GJwEKhvTi4voUz2xz\u0022 width=\u0022100%\u0022 height=\u0022100%\u0022 frameborder=\u00220\u0022 scrolling=\u0022no\u0022 allowfullscreen=\u0022\u0022\u003E\u003C/iframe\u003E","player":"https://embed.api.video/live/li5K1a3GJwEKhvTi4voUz2xz","hls":"https://live.api.video/li5K1a3GJwEKhvTi4voUz2xz.m3u8","thumbnail":"https://cdn.api.video/live/li5K1a3GJwEKhvTi4voUz2xz/thumbnail.jpg"}}],"pagination":{"currentPage":1,"currentPageItems":10,"pageSize":10,"pagesTotal":10,"itemsTotal":92,"links":[{"rel":"self","uri":"/live-streams?currentPage=1\u0026pageSize=10"},{"rel":"first","uri":"/live-streams?currentPage=1\u0026pageSize=10"},{"rel":"next","uri":"/live-streams?currentPage=2\u0026pageSize=10"},{"rel":"last","uri":"/live-streams?currentPage=10\u0026pageSize=10"}]}}

The demo page in glitch.me shows the following error:

  failed to start application on twilight-decorous-mail.glitch.me

  This is most likely because your project has a code error.
  Check your project logs, fix the error and try again.  

Regards
Jaime

Jaime,

That is what I expect when you have a lot of Live Streams. According to our backend - you have 86 livestreams in your account.

Can you send me how you were deleting streams? It appears that is the step that is not working. (And I am not sure why they are not appearing in your dashboard), but it may be a sandbox thing (over 72 hours old).

I’m sorry the sample app is failing (I hate to say I think it’s a Glitch at Glitch). Here’s the Glitch share link https://glitch.com/~twilight-decorous-mail

Doug

Doug,

I just deleted videos using the dashboard interface at https://go.api.video/. I selected the videos and pressed the trash icon. Videos disappeared from the dashboard with the message “Your videos were deleted”…

Maybe that problem is when I stream the video, I am adding “record = true” parameter. I add that in order to allow users to view VOD (that is the goal of that parameter, isn’t it? the reference at https://docs.api.video/reference#post_live-streams does not explain about the use of the parameters).

So, what https://go.api.video/ shows are the saved videos. I think I have to delete the lifestream from my code when the livestream stops recording.

Regards
Jaime

Jaime,

I think we’re narrowing into the issue here.
Let’s start from the top:

  1. You created a Livestream (let’s say “Jaime’s Livestream”). A livestream accepts live video in, and sends HLS live video out. If you stop streaming, the livestream is still there, and you can start streaming again if you’d like.
  2. You have record=true set for your livestream. This means, that when the livestream is stopped, api.video will create a video of that stream (a video on demand or VOD). This VOD is now independent of the livestream (other than the name being “Jaime’s Livestream 2020-10-01 00:00”).

If you query the livestream endpoint - you have one livestream - “Jaime’s Livestream”
If you query the video endpoint, you might have 3 videos:
Jaime’s Livestream 2020-10-01 00:00
Jaime’s Livestream 2020-10-01 01:00
Jaime’s Livestream 2020-10-01 02:00

If you delete Jaime’s Livestream 2020-10-01 01:00, you’ll have 2 videos on the video endpoint.

You’ll also see just 2 videos on go.api.video.
If you visit https://go.api.video/livestreams, you’ll see the livestreams you have created.

Deleting the livestream. When I see your account, all your livestreams have the same “name”. What you can do, is re-use “Jaime’s Livestream” over and over, rather than creating new ones. When you are live, the player will play the live video. But when your stream ends - you’ll have all the recordings as VOD:

Jaime’s Livestream 2020-10-01 00:00
Jaime’s Livestream 2020-10-01 01:00
Jaime’s Livestream 2020-10-01 02:00
Jaime’s Livestream 2020-10-01 03:00

So, if you decide you don’t want one of the recordings to be saved, you can delete it. But the livestream can stay forever, If you are not streaming - it is just sitting there waiting for you to start streaming. Having a livestream that is not transmitting video is free. :slight_smile:

hahaha, got it! I have not realized about the options shown at the top of the page, Videos, Live and Player. I thought it was only a page title :grinning:… and yes, I could see all live videos I streamed, however, how can I delete them? I hope I am not so blind to see where the delete option is in this page :slight_smile:

Thanks
Jaime

Ok, So now you have a bunch of livestreams. To delete, you have to use this endpoint:

For example, the first stream in your output (3-4 messages up in this thread) has ID: li4VP9DPErc6XuaQAi6mytPa
so:
curl --request DELETE --url https://ws.api.video/live-streams/li4VP9DPErc6XuaQAi6mytPa --header ‘authorization: Bearer {api_token}’

You cannot (today) delete livestreams from the website UI.

Doug

Yes… I used my same program to delete all streams and it worked, so I did not need to go one by one manually :slight_smile:

Regards
Jaime