Amazon API Gateway
Developer Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Generate SDKs for an API Using AWS CLI Commands

You can use AWS CLI to generate and download an SDK of an API for a supported platform by calling the get-sdk command. We demonstrate this for some of the supported platforms in the following.

Generate and Download the Java for Android SDK Using AWS CLI

To generate and download a Java for Android SDK generated by API Gateway of an API (udpuvvzbkc) at a given stage (test), call the command as follows:

aws apigateway get-sdk \ --rest-api-id udpuvvzbkc \ --stage-name test \ --sdk-type android \ --parameters groupId='com.mycompany',\ invokerPackage='com.mycompany.myApiSdk',\ artifactId='myApiSdk',\ artifactVersion='0.0.1' \ ~/apps/myApi/myApi-android-sdk.zip

The last input of ~/apps/myApi/myApi-android-sdk.zip is the path to the downloaded SDK file named myApi-android-sdk.zip.

Generate and Download the JavaScript SDK Using AWS CLI

To generate and download a JavaScript SDK generated by API Gateway of an API (udpuvvzbkc) at a given stage (test), call the command as follows:

aws apigateway get-sdk \ --rest-api-id udpuvvzbkc \ --stage-name test \ --sdk-type javascript \ ~/apps/myApi/myApi-js-sdk.zip

The last input of ~/apps/myApi/myApi-js-sdk.zip is the path to the downloaded SDK file named myApi-js-sdk.zip.

Generate and Download the Ruby SDK Using AWS CLI

To generate and download a Ruby SDK of an API (udpuvvzbkc) at a given stage (test), call the command as follows:

aws apigateway get-sdk \ --rest-api-id udpuvvzbkc \ --stage-name test \ --sdk-type ruby \ --parameters service.name=myApiRubySdk,ruby.gem-name=myApi,ruby.gem-version=0.01 \ ~/apps/myApi/myApi-ruby-sdk.zip

The last input of ~/apps/myApi/myApi-ruby-sdk.zip is the path to the downloaded SDK file named myApi-ruby-sdk.zip.

Next, we show how to use the generated SDK to call the underlying API. For more information, see Call REST API through Generated SDKs.