abuzuhri / Amazon-SP-API-CSharp

.Net C# library for the new Amazon Selling Partner API
MIT License
212 stars 186 forks source link

Make a Call with flate file feed #351

Closed abuzuhri closed 1 year ago

abuzuhri commented 1 year ago

Make a Call with flate file feed

first at all, your Library i really helpfull, thank you for that.

We have to migrate from the "old" mws to sp-api. We have a call with the feed POST_FLAT_FILE_INVLOADER_DATA, is there in your library an example for making such a call?

Thank you for your help.

Originally posted by @OliverZemke2021 in https://github.com/abuzuhri/Amazon-SP-API-CSharp/discussions/73

abuzuhri commented 1 year ago

Please try this sample and let us know


            string text = System.IO.File.ReadAllText(@"C:\Users\tareq\Downloads\Beispiel_Upload.txt");

            var feedresultTXT = amazonConnection.Feed.SubmitFeed(text
                                                    , FeedType.POST_FLAT_FILE_INVLOADER_DATA
                                                    , new List<string>() { MarketPlace.UnitedArabEmirates.ID }
                                                    , null
                                                    , ContentType.TXT);

            string pathURL = string.Empty;
            while (pathURL == string.Empty)
            {
                Thread.Sleep(1000 * 30);
                var feedOutput = amazonConnection.Feed.GetFeed(feedresultTXT);
                if (feedOutput.ProcessingStatus == AmazonSpApiSDK.Models.Feeds.Feed.ProcessingStatusEnum.DONE)
                {
                    var outPut = amazonConnection.Feed.GetFeedDocument(feedOutput.ResultFeedDocumentId);

                    pathURL = outPut.Url;
                }
            }
`
abuzuhri commented 1 year ago

Hi @OliverZemke2021

Do you solve your problem?