question

hi_tek_trading avatar image
0 Likes"
hi_tek_trading asked

eBay API interaction for MS ACCESS

i have developed a database and inventory management system inside of access using forms macros queries and tables and a small amount of VBA to take user input through a Drafting form and based on the info, draft an eBay listing using the File Share template that i downloaded. now that this portion of the system works i want to implement the ability to directly interact with eBay on the back end. Right now i am manually uploading the CSV Files and the images to eBay and it saves time over the previous system but is still a bit tedious. The only reason i am undergoing this project is so that i can begin assigning my employees to draft and list the items with as little work on their part as possible. The form only takes a few arguments and dynamically uses them to crate custom fields in the listings and it works quite easily and well. I have no idea where to begin implementing the eBay API so that this can become a fully automated process and need some guidance on a place to start. Just for background i was a computer science major in college but dropped out to start this company so i have a bit of programming knowledge but have never done anything with API's before so its just a bit new. I know this has been done in the VBA language because Ive seen references to it being done online but never any clear documentation on the process. If anyone knows anything about how to get this done in VBA or knows a reference to any documentation it would be greatly appreciated.
excelaccess apimicrosoft-excel
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ashleedawg avatar image
0 Likes"
ashleedawg answered
VBA is not the ideal way to use API's in general, but with enough patience and experimentation it is possible. There are several Q&A's from others seeking programmatic access to the API's via Excel or MS Access. Since everyone's needs are different there isn't really a generic solution. eBay's API's were the first I ever experimented and it was a good (but often frustrating) learning experience and in the process I realized that many of the fundamental "techniques" are transferable to 1000's of other API's from 100's of other companies (a big example being authentication.) Eventually I got an Excel workbook working for my needs (practically held together with rubber bands and glue) and that was the point that I realized it was finally time for me to learn PHP & JS, which makes API access remarkably easier (a few lines of code as opposed to thousands) and can practically be "dropped" into other applications as-is (examples in my case the API's from Spotify and Google Search Console). **[Stack Overflow][1]** is probably the best place to ask or find existing answers to specific issues, and has several tags specific to ebay-api such as https://stackoverflow.com/questions/tagged/ebay-api . Some other pages as examples of what others are doing: - https://forums.developer.ebay.com/questions/11447/accessing-ebay-api-using-vba-in-excel.html - https://www.mrexcel.com/forum/excel-questions/959453-how-import-ebay-orders-into-excel-vba-2.html - https://www.tek-tips.com/viewthread.cfm?qid=1089650 - https://www.peopleperhour.com/freelance-jobs/software-development/integration-api/listing-on-ebay-using-vba-access-2010-and-ebay-api-xml-547995 - https://www.tek-tips.com/viewthread.cfm?qid=1089650 - http://www.office-loesung.de/ftopic465059_0_0_asc.php - https://www.reddit.com/r/excel/comments/70o2c5/add_photos_on_ebay_using_excel_vba/ [1]: http://stackoverflow.com
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

hi_tek_trading avatar image
0 Likes"
hi_tek_trading answered
Is there a standard way you know of to implement JS into my access database or would it have to external and just interacting with the files in the database?
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

blueeyeswdcards avatar image
0 Likes"
blueeyeswdcards answered
@hi_tek_trading You have to read the Advanced Instructions for Ebay File Exchange. I have done almost exactly what you are trying to accomplish. I use MySQL as my Database. Excel VBA for my forms to create the CSV file to upload directly to the Ebay Server. I was stuck for 3 weeks trying to get the code right. I finally paid someone 30 bucks to get the Post correct. lol My code was so close. How frustrating. Make sure to use this Object....(Class) Set objHTTP = CreateObject("MSXML2.XMLHTTP") There is another similar object that didn't work for me. This is the Class to make the Post to the Ebay Server. http://pics.ebay.com/aw/pics/pdf/us/file_exchange/File_Exchange_Advanced_Instructions.pdf Let me know if you need for help. I have all the working code. S.H.
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

hi_tek_trading avatar image
0 Likes"
hi_tek_trading answered
@blueeyeswdcards if you have the code to create a plug and play module for my database where i just have to change a few things for my info i would pay you for it(rather than putting tons of more work in i just want to get this done)
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

blueeyeswdcards avatar image
0 Likes"
blueeyeswdcards answered
@hi_tek_trading I have an upload function that I wrote to upload the CSV file. You would need a token from Ebay for this to work. You would have to change file paths etc And I think you have to import a reference in Accessl VBA for that class I mentioned to work. i believe the reference name is Microsoft ActiveX Data Objects 2.8 Library And/or RecordSet 2.8 Library. I'm not sure how to import that reference in Access because I only use Excel VBA. The IDE for Excel VBA is awful. I'm not sure if I can give you my addy on this site for me to help with the code. I have considered being a Freelancer before. So I find this to be an interesting project!! :) Scott
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

hiperlights_russia avatar image
0 Likes"
hiperlights_russia answered

I've made an eBay API implementation in VBA (Access) several years ago.

BUT I highly recommend you to use PHP and hosted site for it. I have moved and it became A LOT MORE comfortable.

You will be able to get webhooks which is WAY mode easy.


You have to use MSXML2.XMLHTTP60.

This is working function to send a request from VBA.

Function "setDefaultRequestHeaders" just sets other default headers.

You have to set callName + XML payload for it.

Private Function sendRequest(ByVal strEbayAPIFunction As String, _
                             ByVal requestBody As Variant) As Variant
    
    Dim httpRequest As MSXML2.XMLHTTP60, _
        ret
    
    Set httpRequest = New MSXML2.XMLHTTP60
   
    httpRequest.Open "POST", apiURL, False
    httpRequest.setRequestHeader "X-EBAY-API-CALL-NAME", strEbayAPIFunction
    setDefaultRequestHeaders httpRequest
    
    addLogRecord requestBody, "INFORMATION: >Request data"

    httpRequest.send requestBody
    
    If httpRequest.status = 200 Then
        ret = BinaryToUnicode(httpRequest.ResponseBody)
        
        addLogRecord ret, "INFORMATION: RESPONSE data<"
    Else
        txtErrorStatus = httpRequest.status
        txtErrorStatusText = httpRequest.StatusText
        
        addLogRecord StrMake("Error status: %1%3Status text: %2", _
                             httpRequest.status, _
                             httpRequest.StatusText, Chr(13) & Chr(10)), _
                     "ERROR: RESPONSE data<"
        ret = Nothing
    End If
    
    sendRequest = ret
    Set httpRequest = Nothing
End Function


10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.