Create IVS Channel via API

Create an IVS Channel Using API

In this section of the module, you will learn to create a channel using API. If you have created your channel already, you can skip this step and continue to the Start Live Streaming module or click (>) arrow on the right.

  1. Download postman application if you do not have it on your laptop via https://www.postman.com/

  2. Open Postman application, in Launchpad tab, click Create a request link.

  3. In the new request tab, set the HTTP request type to POST. Enter HTTP request URL as https://ivs.us-west-2.amazonaws.com/CreateRecordingConfiguration in the URL box.

  4. Click Authorization tab, select AWS Signature in the TYPE dropdown box.

  5. Copy the value of Access key ID, and Secret access key saved in Create User step, and paste it into AccessKey and SecretKey respectively. Type us-west-2 in AWS region, and ivs in Service Name.

  6. Click Body tab, copy and paste the following JSON text block. The bucketName is the S3 bucket name in the same region, and the name is the recording configuration name. Change the type to JSON. This will change Content-Type header value to application/json

    {
        "destinationConfiguration": { 
            "s3": { 
                "bucketName": "my-ivs-archive"
            }
        },
        "name": "ivs-recording-configuration"
    }
    

  7. Click Send button to execute the API, you should get a 200 OK response with the following information. If you get error messages, be sure to check the API access IAM credentitals do have proper IAM policies attached to the IAM user. Refer to Create an AWS Account for details.

    {
        "recordingConfiguration": {
            "arn": "arn:aws:ivs:us-west-2:xxxxxxxxx:recording-configuration/Q8pvRzOOUTLx",
            "destinationConfiguration": {
                "s3": {
                    "bucketName": "my-ivs-archive"
                }
            },
            "name": "ivs-recording-configuration",
            "state": "CREATING",
            "tags": {}
        }
    }
    
  8. Create another HTTP POST request and repeat the steps to provide access credentials (You can duplicate CreateRecordingConfiguration request and make changes to the URL). Enter HTTP request URL as https://ivs.us-west-2.amazonaws.com/CreateChannel in the URL box.

  9. Click Body tab, copy and paste the following JSON text block, make sure the name value is unique channel name in your account. mytest-channel-1 is used in this example. Copy and paste the recording configuration ARN from last API’s response.

    {
        "authorized": false,
        "latencyMode": "LOW",
        "name": "mytest-channel-1",
        "recordingConfigurationArn": "arn:aws:ivs:us-west-2:xxxxxxxx:recording-configuration/ex42jmAQf0OS"
    }
    

    Change the type to JSON. This will change Content-Type header value to application/json

  10. Now the API is ready! Click Send button, and you should see a successful response with Status 200 OK. Go back to your AWS Console, go to Amazon IVS service (https://us-west-2.console.aws.amazon.com/ivs/home) if you navigated away from this page. Click Channels on the left side menu, you should see your channel (mytest-channel-1 in this example) is listed.

Note: You can check your recordings in the S3 bucket, and can serve the recordings as VOD assets. For example, the recording of my session when served by AWS CloudFront using the S3 bucket as origin, it will take the follow URL format: http://xxxxxxxxx.cloudfront.net/ivs/v1/xxxxxxxxx/6hkjmB6zbTOp/2021/6/11/22/28/KkVcQKQpywiC/media/hls/master.m3u8


Module Summary

In this module, you learnt how to create an IVS channel using the AWS Console or with AWS APIs. Now, we need to provide a stream input to this channel. We will use OBS software to generate a live stream in the Start Live Streaming module.