How to Download a PII Report? #553
Unanswered
feetpeoplellc
asked this question in
Q&A
Replies: 1 comment 2 replies
-
When I use the code below for the CreateReportAndDownloadFile, it finishes without error, but no file is downloaded. ` ` |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
I can download non-PII reports without issue, so that routine is OK. For the PII reports, I am struggling a bit. The code seems fairly straight forward, but I am certain I am not doing something quite correctly.
The Code:
`AmazonConnection amazonConnection = new AmazonConnection(new AmazonCredential()
{
// Insole Dept Credentials
AccessKey = "XXXXX",
SecretKey = "XXXXX",
RoleArn = "arn:xxxx",
ClientId = "amzn1.xxxx",
ClientSecret = "amzn1.xxxxx",
RefreshToken = "XXXXXXXX",
MarketPlace = MarketPlace.US,
});
The code with the error is on this row above: var reportData = amazonConnection.Reports.GetReportDocument(reportId,true);
Error:
[RateLimits ,Report_CreateReport]: 4/14/2023 3:25:34 PM Request/Burst: 1/15 Rate: 0.0167/59880ms
Unhandled exception. FikaAmazonAPI.AmazonSpApiSDK.Models.Exceptions.AmazonInvalidInputException: Invalid or unsupported document ID found
at FikaAmazonAPI.Services.RequestService.ParseResponse(RestResponse response)
at FikaAmazonAPI.Services.RequestService.ExecuteRequestTry[T](RateLimitType rateLimitType, CancellationToken cancellationToken)
at FikaAmazonAPI.Services.RequestService.ExecuteRequestAsync[T](RateLimitType rateLimitType, CancellationToken cancellationToken)
at FikaAmazonAPI.Services.RequestService.CreateRestrictedDataTokenAsync(CreateRestrictedDataTokenRequest createRestrictedDataTokenRequest, CancellationToken cancellationToken)
at FikaAmazonAPI.Services.RequestService.RefreshTokenAsync(TokenDataType tokenDataType, CreateRestrictedDataTokenRequest requestPII, CancellationToken cancellationToken)
at FikaAmazonAPI.Services.RequestService.CreateAuthorizedRequestAsync(String url, Method method, List`1 queryParameters, Object postJsonObj, TokenDataType tokenDataType, Object parameter, CancellationToken cancellationToken)
at FikaAmazonAPI.Services.ReportService.GetReportDocumentAsync(String reportDocumentId, Boolean isRestrictedReport, CancellationToken cancellationToken)
at FikaAmazonAPI.Services.ReportService.GetReportDocument(String reportDocumentId, Boolean isRestrictedReport)
at AmazonReportsv2.Program.Main(String[] args) in C:\source\repos\AmazonReportsv2\AmazonReportsv2\Program.cs:line 67
What did I do differently in this code vs the code for running/downloading reports without PII?
Changed this code... (by following the example of downloading PII)
And... changed the report to the Unshipped Orders Report (parameters.reportType = ReportTypes.GET_FLAT_FILE_ACTIONABLE_ORDER_DATA_SHIPPING;)
Amazon has confirmed that we have access to PII and there is not an error of "access denied".
The CreateReportAndDownloadFile method, I also cannot get to work; although this seems like an easier route.
Thank you for taking a look!
Beta Was this translation helpful? Give feedback.
All reactions