Wednesday, February 22, 2017

Amazon - Alexa - Tips to start your own Skill Kit

Why Alexa ?

Alexa, the voice service that powers Echo, provides capabilities, or skills, that enable customers to interact with devices in a more intuitive way using voice. (Coolest IoT as well to integrate with lights and thermostat control through Amazon Echo)

Examples of these skills include the ability to play music, answer general questions, set an alarm or timer and more. Alexa is built in the cloud, so it is always getting smarter.

Official Amazon Pages about
Alexa : https://developer.amazon.com/alexa
Alexa Skill Kit : https://developer.amazon.com/alexa-skills-kit

Alexa Skill Kit (ASK) develop in an hour quick tour to get your hands dirty (JS) - Note : Alexa Skill Interaction Model creation was not updating in IE. Better use firefox / chrome.
6 Steps to build first Alexa Skill : https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/content/fact-skill-1

Steps Detailed to develop : https://developer.amazon.com/blogs/post/Tx3DVGG0K0TPUGQ/New-Alexa-Skills-Kit-Template:-Step-by-Step-Guide-to-Build-a-Fact-Skill

Alexa Skill kit Samples : https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/using-the-alexa-skills-kit-samples

Alexa Web Browser Testing tool (Works only in webRTC (RTC-RealTimeCommunication Browser)) : https://echosim.io/welcome?next=%2F

Alexa Skill Kit (ASK) forum : https://forums.developer.amazon.com/spaces/23/index.html

ASK Certification Requirements for Custom Skills : https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-submission-checklist

ASK custom skill using Web-Service - https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/deploying-a-sample-skill-as-a-web-service

Amazon 10 Minutes tutorial (Try tutorials in AWS) - https://aws.amazon.com/getting-started/tutorials/

Social Pages (YouTube) about Alexa to watch and learn :

ASK 101 by Amazon Developer : https://www.youtube.com/watch?v=31K4vse9Jmc

ASK Custom skill easy implementation step in more understandable with intents and slots includes nice examples and github sourceCode reference: https://www.youtube.com/watch?v=zt9WdE5kR6g&t=1s

Developing Alexa Skill (Explained in 1 to 6 chapter in more detail) : https://www.youtube.com/watch?v=QxgdPI1B7rg&list=PL2KJmkHeYQTO6ci5KF08mvHYdAZu2jgkJ


Find your icon for your custom app : https://www.iconfinder.com/icons/10930/badge_reddit_icon#size=128

In MSPaint open the image 512 and click -> re-size and re-size the image to size you need.

Client / Server Authentication using openssl

Steps to Create CSR (Certificate Signing Request) using OpenSSL and create JKS file to interact with Server

What is client authentication?
Client Authentication is the process by which users securely access a server or remote computer by exchanging a Digital Certificate.

#To create CSR and Private Key
openssl req -new -newkey rsa:2048 -nodes -out star_yourdomainname_com.csr -keyout star_yourdomainname_com.key -subj "/C=US/ST=New Jersey/L=Bedminster/O=Organization Name/OU=Organization Unit/CN=*.yourdomainname.com"

# Combine private key and public key file received from 3rd party
cat star_yourdomainname_com.key star_yourdomainname_com.pem_SIGNED.pem > projectName.pem

# Generate pkcs12 file from private + public key file
openssl pkcs12 -export -in projectName.pem -out projectNamekeystore.pkcs12 -name projectName -noiter -nomaciter

# Create jks File from pkcs12 file generated
keytool -importkeystore -srckeystore projectNamekeystore.pkcs12 -srcstoretype pkcs12 -srcalias projectName -destkeystore projectNameKeyStore.jks -deststoretype jks -deststorepass pass@123 -destalias projectName

# To list the keystore stored
keytool -v -list -keystore keystore

Write Java program using HttpClient to test this JKS file and Get / Post the data from 3rd party server

Curl : Through curl also same works and testing can be done

# Combine private key and public key file received from 3rd party
cat star_yourdomainname_com.key star_yourdomainname_com.pem_SIGNED.pem > projectName.pem

Curl Command :
curl -k -vvvv --request GET -H "Accept: application/json" -H "Content-Type: application/json" -a --cert projectName.pem "https://thirdpartydomainname.com/WebGateway/rest/Location/query/location?userId=1234"
// Below script tag for SyntaxHighLighter