I have developed a skill and deployed using ASK CLI. The skill works, the in skill purchasing GET request is where I have trouble. I am getting the Exception on my GET request: "There was an error with the connection to amazonException: The remote server returned an error: (403) Forbidden."
This is the GET request in C#. I have verified the apiAccessToken is being rendered where I use it, however, I'm not sure if I'm adding the headers correct for a GET request (maybe POST?):
public static string GETRequestHeaders(MySkillRequest request) { string responseText = ""; string requestUri = @"https://api.amazonalexa.com/v1/users/~current/skills/~current/inSkillProducts"; advancedClient = WebRequest.Create(requestUri) as HttpWebRequest; advancedClient.Method = "GET"; advancedClient.ContentType = "application/json"; advancedClient.Headers["Accept-Language"] = "en-US"; // Need to receive this from request, add locale property to MySkillRequest class. advancedClient.Headers["authorization"] = request.Context.System.apiAccessToken; responseText = advancedClient.RequestUri.ToString(); responseText += advancedClient.RequestUri.Query; responseText += advancedClient.Headers.ToString(); HttpWebResponse response; try { using (response = advancedClient.GetResponse() as HttpWebResponse) { StreamReader str = new StreamReader(response.GetResponseStream()); responseText += str.ReadToEnd(); } } catch (Exception ex) { responseText += "There was an error with the connection to amazon"; responseText += "Exception: " + ex.Message; } return responseText; }