@NutritionGuy, Oh I forgot to put in the assume role task.
‘’’ private static async Task GetAssumeRoleTokenDetail()
{
// AWS IAM user data, NOT seller central dev data
var accessKey = “…”; // get from users access key id from first step
var secretKey = “…”; // get from users secret key from first step
var credentials = new BasicAWSCredentials(accessKey, secretKey);
var client = new AmazonSecurityTokenServiceClient(credentials);
var assumeRoleRequest = new AssumeRoleRequest()
{
DurationSeconds = 3600,
// role ARN you create here:
// https://github.com/amzn/selling-partner-api-docs/blob/main/guides/developer-guide/SellingPartnerApiDeveloperGuide.md#step-4-create-an-iam-role
RoleArn = "arn:aws:iam::*:role/SellerRoleAPI",
RoleSessionName = DateTime.Now.Ticks.ToString()
};
var assumeRoleResponse = await client.AssumeRoleAsync(assumeRoleRequest);
Console.WriteLine(assumeRoleResponse.HttpStatusCode);
return assumeRoleResponse;
}
‘’’