skip to Main Content

I want to achieve the following goal. Migrating my File Exchange Application to new eBay feed api.

Please check the concern page.

API – Feed Reference:

Link to File Exchange Migration Procedure

Link to eBay Sell Feed API

I am adopting their procedure as stated on the above links but I am receiving the following error while calling Sell Feed API -> uploadFile method.

"errorId": 2003,
      "domain": "ACCESS",
      "category": "APPLICATION",
      "message": "Internal error",
      "longMessage": "There was a problem with an eBay internal system or process. Contact eBay developer support for assistance",
      "parameters": [
        { "name": "code",  "value": "400"  },
        { "name": "message", "value": "HTTP 400 Bad Request"  }

Please check my request.

Endpoint: "https://api.ebay.com/sell/feed/v1/task/task-40-xxxxxxxxx/upload_file"

Request Headers:

Authorization:Bearer myToken
Accept:application/json
Content-Type:multipart/form-data
X-EBAY-C-MARKETPLACE-ID: EBAY_US

Payload:

{ 
"fileName" : "https://virtualwebdesk.com/brad/feed.csv",
"name" : "file",
"type" : "form-data"
}

Please Note: I create TaskID first and then pass in the call.

2

Answers


  1.     This code is in C# - RestClient
        
        createTask
        ==========
        var client = new RestClient("https://api.ebay.com/sell/feed/v1/task");
        client.Timeout = -1;
        var request = new RestRequest(Method.POST);
        request.AddHeader("Authorization", "Bearer v^1.1#i^1****** YOUR USER ACCESS TOKEN *********Ql3QYER3BQAAA==");
        request.AddHeader("Accept", "application/json");
        request.AddHeader("Content-Type", "application/json");
        request.AddHeader("X-EBAY-C-MARKETPLACE-ID", "EBAY_GB");
        var body = @"{
        " + "n" +
        @"  ""schemaVersion"": ""1149"",
        " + "n" +
        @"  ""feedType"": ""LMS_REVISE_INVENTORY_STATUS""
        " + "n" +
        @"}";
        request.AddParameter("application/json", body,  ParameterType.RequestBody);
        IRestResponse response = client.Execute(request);
        Console.WriteLine(response.Content);
        
        Response:
        location:https://api.ebay.com/sell/feed/v1/task/task-12-1127376027
        
        task-12-1127376027 is your TaskID
        
        uploadFile
        ==========
    test.xml
    --------
    
    <?xml version="1.0" encoding="utf-8" ?>
    <BulkDataExchangeRequests xmlns="urn:ebay:apis:eBLBaseComponents">
        <Header>
            <Version>685</Version>
            <SiteID>3</SiteID>
        </Header>
        <ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">
            <ErrorLanguage>en_US</ErrorLanguage>
            <WarningLevel>High</WarningLevel>
            <MessageID>test-1111</MessageID>
            <Version>637</Version>
            <InventoryStatus ComplexType="InventoryStatusType">
                <SKU>test-1111</SKU>
                <Quantity>2</Quantity>
            </InventoryStatus>
        </ReviseInventoryStatusRequest>
        <ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">
            <ErrorLanguage>en_US</ErrorLanguage>
            <WarningLevel>High</WarningLevel>
            <MessageID>test-2222</MessageID>
            <Version>637</Version>
            <InventoryStatus ComplexType="InventoryStatusType">
                <SKU>test-2222</SKU>
                <Quantity>0</Quantity>
            </InventoryStatus>
        </ReviseInventoryStatusRequest>
    </BulkDataExchangeRequests>
    
    
        var client = new RestClient("https://api.ebay.com/sell/feed/v1/task/task-12-1127376027/upload_file");
        client.Timeout = -1;
        var request = new RestRequest(Method.POST);
        request.AddHeader("Authorization", "Bearer v^1.1#i^1****** YOUR USER ACCESS TOKEN *********Ql3QYER3BQAAA==");
        request.AddHeader("X-EBAY-C-MARKETPLACE-ID", "EBAY_GB");
        request.AddHeader("Accept", "application/json");
        request.AddHeader("Content-Type", "multipart/form-data");
        request.AddParameter("fileName", "test.xml");
        request.AddFile("file", "F:/test.xml");
        request.AddParameter("type", "form-data");
        IRestResponse response = client.Execute(request);
        Console.WriteLine(response.Content);
        
        Response: "StatusCode: OK, Content-Type: , Content-Length: 0)"
        
        getTask
        ========
        var client = new RestClient("https://api.ebay.com/sell/feed/v1/task/task-12-1235290549");
        client.Timeout = -1;
        var request = new RestRequest(Method.GET);
        request.AddHeader("Authorization", "Bearer v^1.1#i^1****** YOUR USER ACCESS TOKEN *********Ql3QYER3BQAAA==");
        request.AddHeader("Accept", "application/json");
        request.AddHeader("Content-Type", "application/json");
        IRestResponse response = client.Execute(request);
        Console.WriteLine(response.Content);
        
        Response:
        {
            "taskId": "task-12-1127376027",
            "status": "COMPLETED",
            "feedType": "LMS_REVISE_INVENTORY_STATUS",
            "creationDate": "2022-02-09T11:39:50.000Z",
            "completionDate": "2022-02-09T11:50:34.000Z",
            "uploadSummary": {
                "successCount": 2,
                "failureCount": 0
            }
        }
    
    Login or Signup to reply.
  2. I got it,

     <InventoryStatus ComplexType="InventoryStatusType"> => <InventoryStatus>
    
        
    <?xml version="1.0" encoding="utf-8" ?>
    <BulkDataExchangeRequests xmlns="urn:ebay:apis:eBLBaseComponents">
        <Header>
            <Version>685</Version>
            <SiteID>0</SiteID>
        </Header>
        <ReviseInventoryStatusRequest xmlns="urn:ebay:apis:eBLBaseComponents">
            <InventoryStatus>
                <ItemID>2645246754</ItemID>
                <Quantity>2</Quantity>
                <SKU>SY0195Y</SKU>
            </InventoryStatus>
            <ErrorLanguage>en_US</ErrorLanguage>
            <MessageID>ttt33</MessageID>
            <Version>637</Version>
            <WarningLevel>High</WarningLevel>
        </ReviseInventoryStatusRequest>
    </BulkDataExchangeRequests>
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search