Closed cgaugel closed 2 years ago
@cgaugel I dont know about your first issue but for the second issue there is a missing step in document.
You need to get assume role for your user you created and use that AWS key and secret (also that call returns session token too you need to put it that as well)
This is for C# code snippet you will understand what I mean
AssumeRoleResponse assumeRoleResponse = null; using (var STSClient = new AmazonSecurityTokenServiceClient(accessKey, secretKey, RegionEndpoint.USEast1)) { var req = new AssumeRoleRequest() { RoleArn = roleARN, DurationSeconds = 950, //put something works for you RoleSessionName = Guid.NewGuid().ToString() };
assumeRoleResponse = STSClient.AssumeRoleAsync(req, new CancellationToken()).Result;
}
//auth step 3
var awsAuthenticationCredentials = new AWSAuthenticationCredentials
{
AccessKeyId = assumeRoleResponse.Credentials.AccessKeyId,
SecretKey = assumeRoleResponse.Credentials.SecretAccessKey,
Region = "us-east-1"
};
restRequest.AddHeader("x-amz-security-token", assumeRoleResponse.Credentials.SessionToken);
so in this step above:
accessKey is the key you downloaded while you create your user accessSecret same as above roleARN: thats the role ARN you created
Again not sure how to add this in PHP but you need to add session token to your request header...
good luck
@cgaugel @tenitre Followed this thread here I was able to crack the problem in PHP. There is a solution, but it is dirty and immature. I've already described it here: https://github.com/clousale/amazon-sp-api-php/issues/8#issuecomment-737547316
This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.
Hi together,
I registered as an Developer using the following instruction: https://github.com/amzn/selling-partner-api-docs/blob/main/guides/developer-guide/SellingPartnerApiDeveloperGuide.md
My Application is listed as "published" in my sellercentral account: https://ibb.co/82X33Rm
Problem 1: My Application is not shown at the Amazon Marketplace Appstore - why?
Now I went to the url https://sellercentral.amazon.de/sellingpartner/developerconsole/authorize?appId=amzn1... and made a refresh token for my seller account. After that, I exchanged the RefreshToken with an access_token:
curl --location --request POST 'https://api.amazon.com/auth/o2/token' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'grant_type=client_credentials' \ --data-urlencode 'refresh_token=Atzr.....' \ --data-urlencode 'client_id=amzn1...' \ --data-urlencode 'client_secret=XXX \ --data-urlencode 'scope=sellingpartnerapi::migration'
Then I received an access_token. Now I would like to make an API-Call using this code:
I receive the following exception:
Any help? What am I doing wrong?