Package: ask-smapi-sdk
ASK SMAPI SDK - Alexa Skills Management API Python Libraryask-smapi-sdkis the Python library package for Alexa
Skill Management API (SMAPI). SMAPI is a set of API
operations that allow you to programmatically manage
and test Alexa skills and related resources such as
interaction models. More information on SMAPI can be
found atAlexa Developer Documentation.Quick StartInstall ASK SMAPI SDKInstallation from PyPIAssuming that you have Python andvirtualenvinstalled, you can
install the package and it’s dependencies (ask-smapi-model) from PyPI
as follows:$virtualenvvenv$.venv/bin/activate$pipinstallask-smapi-sdkInstallation from Github$gitclonehttps://github.com/alexa/alexa-skills-kit-sdk-for-python.git$cdalexa-skills-kit-sdk-for-python/ask-smapi-sdk$virtualenvvenv...$.venv/bin/activate$pythonsetup.pyinstallInstall NPM and the ASK CLIInstall NPM using the instructions provided here:get-npm.This is needed to get started with the ASK CLI, which will be used to generate
Login with Amazon tokens you will need to access SMAPI.Assuming that you havenpminstalled, you can install the package
from NPM as follows:$npminstallask-cli-gGenerate Login with Amazon KeysCreate a new security profile for your Amazon Developer account by following the instructions
provided here:Generate LWA Keys.This will generateClient IDandClient Secretkeys.Using the ASK CLI, run: ask util generate-lwa-tokens. You will be asked to provide theClient IDandClient Secretkeys from the previous step. This will return the following JSON with aRefresh Token:{"access_token":"ACCESS_TOKEN","refresh_token":"REFRESH_TOKEN","token_type":"bearer","expires_in":3600,"expires_at":"2019-11-19T20:25:06.584Z"}Configure SMAPI ClientImport StandardSmapiBuilder from ask_smapi_sdk.Create an instance of StandardSmapiBuilder passing clientId, clientSecret and refreshToken as parameters.Create a smapiClient instance by invoking client method on builder instance.You can invoke SMAPI method call using the smapi_client instance and passing parameters corresponding to the method signatures.Usage ExamplesFor the complete list of functions, please see the ASK SMAPI SDK documentation.List Skillsfromask_smapi_sdkimportStandardSmapiBuildersmapi_client=StandardSmapiBuilder(client_id='Client ID',client_secret='Client Secret Key',refresh_token='Refresh Token').client()try:result=smapi_client.list_skills_for_vendor_v1(vendor_id='Vemdor ID',full_response=True)print("==========================================")print(result.headers)print(result.body)print("==========================================")exceptExceptionase:print(e.message)Get Skill Manifestfromask_smapi_sdkimportStandardSmapiBuildersmapi_client=StandardSmapiBuilder(client_id='Client ID',client_secret='Client Secret Key',refresh_token='Refresh Token').client()try:result=smapi_client.get_skill_manifest_v1(skill_id='SKILL ID',stage='SKILL STAGE')print("==========================================")print(result)print("==========================================")exceptExceptionase:print(e.message)DocumentationSMAPI SDK Reference Documentation.SMAPI DocumentationGot Feedback?We would like to hear about your bugs, feature requests, questions or quick feedback.
Please search for theexisting issuesbefore opening a new one. It would also be helpful
if you follow the templates for issue and pull request creation. Please follow thecontributing guidelinesRequest and vote forAlexa featuresCHANGELOG1.0.0Initial release ask smapi sdk.