stoiveyp / Alexa.NET.ListManagement

A simple .NET Core library for handling lists within Alexa skills
MIT License
1 stars 1 forks source link
alexa alexa-skills-kit dotnet-core lists

Alexa.NET.ListManagement

A simple .NET Core library for handling lists within Alexa skills

Before you start make sure you have An Alexa Skill with appropriate permissions (if you're unsure of how to do this - the docs are here)

Initialising your list client

This assumes you're already using Alexa.NET for your Alexa skill access

var accessToken = skillRequest.Context.System.ApiAccessToken;
var client = new Alexa.NET.ListManagementClient(accessToken);

 

Output all lists

var lists = await client.GetListsMetadata();
foreach(var list in lists)
{
    Console.WriteLine($"{list.ListId} - {list.Name}");
}

 

Output items for a single list

var list = await client.GetList(listId);
foreach(var item in list.Items)
{
    Console.Writeine(item.Value);
}

 

Add Skill Event support to Alexa.NET

 RequestConverter.RequestConverters.Add(new ListSkillEventRequestTypeConverter());