0

Im having major dramas getting the Amazon Alexa address api to work in the C# Web Api app i have created using AlexaSkillsKit.Net

var apiEndpoint = context.System.ApiEndpoint;
var deviceId = context.System.Device.DeviceId;
var apiAccessToken = context.System.ApiAccessToken;

var url = string.Format("{0}/v1/devices/{1}/settings/address", apiEndpoint, deviceId);

var client = new HttpClient();
client.DefaultRequestHeaders.Clear();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiAccessToken);
client.DefaultRequestHeaders.Add("User-Agent", "Request-Promise");
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

string response = client.GetAsync(url).Result.Content.ReadAsStringAsync().Result;

The response i get back is as follows:

{"type":"FORBIDDEN","message":"The authentication token is not valid."}

Im at a loss as to why im getting this error I have given my app permissions to get the Full Address

Frazer
  • 560
  • 2
  • 11
  • 21

1 Answers1

0

I have got this to work, i just needed to send the Permissions Card back to the user

https://developer.amazon.com/docs/custom-skills/device-address-api.html

Frazer
  • 560
  • 2
  • 11
  • 21