Guides: Get Started with Mux’s Postman Collection
Hey, this is Thuy (Twee). I'm a Community Engineer at Mux. Today,
I'll be showing you how to get started quickly with Mux's Postman collection.
To get started with the Mux API, you're going to need an account first.
You can make an account by going to the Mux homepage, at mux.com,
Scrolling to the bottom and clicking create account.
Once you create an account,
you can go into your settings on the left nav bar,
left side menu, and click generate new token.
Let's click the big green button, generate token.
We have our access token ID and our secret key.
Let's add those to our environment variables in the Mux Postman collection. For
the sake of time,
I've already gone and added these credentials to the Postman collection,
but here's a little sneak peek so that you know what to look for. In
Postman, you can create,
a new environment where you can save your token ID and your secret key as
a secret. And then every time that you make a request after that,
it will make it with the appropriate credentials.
There are a couple requests that I wanna show you how to do.
The first one has to do with assets.
Assets are any media content that is stored or live streamed
inside Mux. It could be audio, video, or text.
Let's start by creating an asset.
Let's go to post and then hit send.
We've got data back about our asset,
but the thing that we really want is the playback ID.
We can use this playback ID to stick it inside of one of the players
that Mux offers. Um, in order to play this asset back.
Let's copy our playback ID and use something like Mux Player.
So Mux offers a,
an open source web component called Mux Player,
where you can just easily paste in your playback ID and it will play the
video that you pass it. So we just copied our playback ID from Postman.
Let's paste it in here. Save it. And what do we get?
We get the test video.
Last, but not least, is live streams.
Similar to assets earlier in the quick start,
you can create a live stream by making a post request.
This is the data that you're gonna get back.
You'll see a very familiar playback ID.
After you run the live stream,
you're able to take the playback ID and stick it into a player like the
Mux Player that I showed you earlier and play the livestream.
This is an example of what that would look like once you have an active live
stream that is complete. You can take that playback ID,
stick it into the playback ID section of the Mux Player,
change the stream type from on-demand to live. And there you go!
You have playback for your live stream. Well,
there you have it.
That was an under 10 minute quick start Mux's API via the Mux
Postman collection.
We showed you how to set up your Postman collection with basic authentication,
and also walked you through some of the most popular requests that people make
with the Mux API,
such as creating an asset and creating a live stream,
plus all of the extra context and resources that you might need
to go forth and build all the beautiful video applications that you can build
with the Mux API. That's it!
This was Thuy (Twee). I'm out.