

# Getting Started with AWS Elemental MediaConvert Using the AWS SDKs or the AWS CLI
Getting Started with the AWS SDKs and the CLI

To get started with AWS Elemental MediaConvert using one of the AWS SDKS or the AWS Command Line Interface (AWS CLI), follow this general procedure.

1. Set up AWS Identity and Access Management (IAM) permissions for both yourself and for the MediaConvert service to access your resources on your behalf:
   + For information about setting up permissions for yourself, see [Overview of Identity Management: Users](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_identity-management.html) in the *IAM User Guide*.
   + For information about setting up permissions for the service to access your resources, see [Set Up IAM Permissions](https://docs.aws.amazon.com/mediaconvert/latest/ug/iam-role.html) in the *MediaConvert User Guide*.

1. In your client configuration, specify your authentication credentials and your AWS Region. For instructions that are specific to the programming language that you use, choose from this list of links to open the relevant topics in the AWS CLI or SDK guides:
   +  [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html)
   + C\$1\$1: [credentials](https://docs.aws.amazon.com/sdk-for-cpp/latest/developer-guide/credentials.html) and [Region](https://docs.aws.amazon.com/sdk-for-cpp/latest/developer-guide/client-config.html)
   +  [ Go ](https://docs.aws.amazon.com/sdk-for-go/latest/developer-guide/configuring-sdk.html)
   + [Java](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/setup-credentials.html)
   + [JavaScript](https://docs.aws.amazon.com/sdk-for-javascript/latest/developer-guide/setting-credentials.html) 
   + [.NET](https://docs.aws.amazon.com/sdk-for-net/latest/developer-guide/net-dg-config.html)
   + [PHP](https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_configuration.html)
   + Python: [credentials](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html) and [Region](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html#environment-variable-configuration)
   + [Ruby](https://docs.aws.amazon.com/sdk-for-ruby/latest/developer-guide/setup-config.html)
   + [Tools for PowerShell](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-getting-started.html)

1. To prevent duplicate jobs from being created, use client request tokens. For more information see [Preventing duplicate jobs](idempotency.md).

**Choosing the correct case for requests**  
When you send requests, use camelCase or PascalCase as appropriate for the language you are using. All examples in this guide use PascalCase, which is the correct casing for the AWS CLI and AWS SDK for Python (Boto3). The MediaConvert console JSON export function also generates JSON job specifications in PascalCase.

When you use a language that specifies camelCase, such as JavaScript, you must convert the casing of your properties before you submit your requests. For example, if you use the properties "Settings" and "TimecodeConfig" in your call through the AWS CLI, you must change those to "settings" and "timecodeConfig" for your call through the AWS SDK for JavaScript.

# AWS Elemental MediaConvert CreateJob Example Using the AWS CLI
CreateJob Example Using the AWS CLI

A job does the work of transcoding a media file. When you create a job using the AWS CLI, you specify the job settings that AWS Elemental MediaConvert requires to perform the transcoding.

**To create a transcoding job using the AWS CLI:**
+ Specify your job settings with `--cli-input-json`:

  ```
  aws mediaconvert create-job \
      --region region-name-1 \ 
      --cli-input-json file://job.json
  ```

  In the preceding example, `job.json` specifies your job settings. You can use the MediaConvert console to generate the JSON job specification. For more information and sample job specifications, see [Creating Your Job Specification](creating-your-json-job-specification.md).

  For more information about how to create a job using the AWS CLI, see the [AWS CLI command reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/mediaconvert/create-job.html).

# Preventing duplicate jobs


You can use *client request tokens* to ensure that a `create-job` API request completes only once. With these requests, if the original request completes successfully, subsequent requests have no additional effect. This is useful to prevent duplicate jobs from being created when you interact with the AWS Elemental MediaConvert API.

A client request token is a unique string that you specify when you make a create job request.

A client request token can be any string that includes up to 64 ASCII characters. If you reuse a client request token within one minute of a successful request, the API returns the job details of the original request instead.

**The following AWS CLI command creates an idempotent CreateJob request with the client request token *example-token***.

```
aws mediaconvert create-job \
    --client-request-token example-token \
    --region region-name-1 \
    --cli-input-json file://job.json
```

For more information about how to create a job using the AWS CLI, see the [AWS CLI command reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/mediaconvert/create-job.html).

# Using MediaConvert with an AWS SDK


AWS software development kits (SDKs) are available for many popular programming languages. Each SDK provides an API, code examples, and documentation that make it easier for developers to build applications in their preferred language.

For code examples specific to AWS Elemental MediaConvert, see the [AWS SDK code example library](https://docs.aws.amazon.com/code-library/latest/ug/mediaconvert_code_examples_actions.html). These include examples for the MediaConvert actions `CreateJob`, `GetJob`, and `ListJobs` for .NET, C\$1\$1, AWS Command Line Interface (CLI), Java, and Kotlin.

The following table provides links to AWS SDK documentation and general AWS SDK code examples on GitHub.


| AWS SDK documentation | Code examples (GitHub) | 
| --- | --- | 
|  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/sdk-for-cpp)  |  [AWS SDK for C\$1\$1 code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp)  | 
|  [AWS SDK for Go](https://docs.aws.amazon.com/sdk-for-go)  |  [AWS SDK for Go code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/gov2)  | 
|  [AWS SDK for Java](https://docs.aws.amazon.com/sdk-for-java)  |  [AWS SDK for Java code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2)  | 
|  [AWS SDK for JavaScript](https://docs.aws.amazon.com/sdk-for-javascript)  |  [AWS SDK for JavaScript code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3)  | 
|  [AWS SDK for Kotlin](https://docs.aws.amazon.com/sdk-for-kotlin)  |  [AWS SDK for Kotlin code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin)  | 
|  [AWS SDK for .NET](https://docs.aws.amazon.com/sdk-for-net)  |  [AWS SDK for .NET code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/dotnetv3)  | 
|  [AWS SDK for PHP](https://docs.aws.amazon.com/sdk-for-php)  |  [AWS SDK for PHP code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/php)  | 
|  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/pythonsdk)  |  [AWS SDK for Python (Boto3) code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python)  | 
|  [AWS SDK for Ruby](https://docs.aws.amazon.com/sdk-for-ruby)  |  [AWS SDK for Ruby code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/ruby)  | 
|  [AWS SDK for Rust](https://docs.aws.amazon.com/sdk-for-rust)  |  [AWS SDK for Rust code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rust_dev_preview)  | 
|  [AWS SDK for Swift](https://docs.aws.amazon.com/sdk-for-swift)  |  [AWS SDK for Swift code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/swift)  | 