Find Jobs
Hire Freelancers

I need to upload an image to woocommerce using.net vb and the woocommerce api (http access)

$10-30 USD

Ditutup
Disiarkan 3 bulan yang lalu

$10-30 USD

Dibayar semasa penghantaran
Below is my current code (ASYNC FUNCTION) that does not work ! Response always false ! Public Async Function UploadImageAsync(imagePath As String, altText As String) As Task Using client As New HttpClient() Dim usec As String = Para(Val(TermNumber), 483) 'for testing hard code para 483 usec = "[login to view URL]|ck_key |cs_key" If DatabaseUSE = 2 Then usec = Para(Val(TermNumber), 535) End If If DatabaseUSE = 3 Then usec = Para(Val(TermNumber), 601) 'shopify info End If If InStr(usec, "|") = 0 Then Exit Function End If Dim keysN() As String = Split(usec, "|") keysN(0) = LCase(keysN(0)) Dim myString As String = keysN(0) Dim lastCharacter As String = [login to view URL]([login to view URL] - 1, 1) If lastCharacter <> "/" Then keysN(0) = LCase(keysN(0)) + "/" End If keysN(0) = Replace(keysN(0), "/v2", "/v3") keysN(0) = Replace(keysN(0), "/wc/v3", "/wp/v2/media") Dim BaseUrl1 As String = keysN(0) BaseUrl1 = Mid(BaseUrl1, 1, Len(BaseUrl1) - 1) ' Authorization keys Dim AuthKeys As String = keysN(1) & ":" & keysN(2) [login to view URL] = New [login to view URL]("Basic", [login to view URL]([login to view URL](AuthKeys))) Dim imageBytes As Byte() = [login to view URL](imagePath) Dim base64Image As String = [login to view URL](imageBytes) ' Extract the file name from the image path Dim fileName As String = [login to view URL](imagePath) Dim postData As String = [login to view URL](New With { .image = New With { .src = base64Image, .name = fileName, .alt = If([login to view URL](altText), "Uploaded Image", altText) ' Use provided alt text or default } }) Dim content = New StringContent(postData, [login to view URL], "application/json") Try Dim response As HttpResponseMessage = Await [login to view URL](BaseUrl1, content) If [login to view URL] Then Dim responseData As String = Await [login to view URL]() Dim jsonResponse As JObject = [login to view URL](responseData) Dim realImageUrl As String = jsonResponse("source_url").ToString() MsgBox(realImageUrl) ' Process the response here Else ' Handle unsuccessful response End If Catch ex As Exception ' Handle exception End Try End Using End Function You either need to fix the code or give me code that will work !
ID Projek: 37481906

Tentang projek

6 cadangan
Projek jarak jauh
Aktif 2 bulan yang lalu

Ingin menjana wang?

Faedah membida di Freelancer

Tetapkan bajet dan garis masa anda
Dapatkan bayaran untuk kerja anda
Tuliskan cadangan anda
Ianya percuma untuk mendaftar dan membida pekerjaan
6 freelancers are bidding on average $36 USD for this job
Avatar Pengguna
Top 1% in Freelancer.com Hi, Greetings! ✅checked your project details: ✅Completed Time: In project deadline We have worked on 900 + Projects. I have 6 + years of the experience in same kind of projects. If you are looking for a true Freelancer, I am the Right person for you. I am available almost 24-7 and am very responsive. I feel proud that I am a trusted Freelancer who pleases almost every single client. You can rest assure, your work will be delivered well in advance of others, with passion and accuracy. I guarantee you instant communication & responses when you need me. Why choose me? I think every client is the reason for my success. I only take projects which I am sure I can do quickly. My Portfolio Items: https://www.freelancer.com/u/schoudhary1553 I would really like to work with you on this project. If interested, Kindly contact me via chat for further details and discussion. Thank you Sandeep
$80 USD dalam 3 hari
5.0 (289 ulasan)
8.1
8.1
Avatar Pengguna
Hi there, Thank you for considering our services. We have reviewed the code you provided and understand that you are experiencing issues with the current implementation. We would be happy to assist you in resolving the problem. Based on our analysis, it seems that the issue may lie in the authentication process or the API endpoint being used. We recommend the following steps to troubleshoot and fix the code: 1. Verify the authentication keys: Double-check the values of `ck_key` and `cs_key` in the `usec` variable. Ensure that they are correct and correspond to the API you are trying to access. 2. Check the API endpoint: Review the `keysN(0)` variable and ensure that it is pointing to the correct API endpoint. Make sure that the URL is valid and properly formatted. 3. Update the API version: Modify the `keysN(0)` variable to use the correct API version. Replace `/v2` with `/v3` to match the desired version. 4. Adjust the API endpoint: Replace `/wc/v3` with `/wp/v2/media` in the `keysN(0)` variable to target the media endpoint specifically. 5. Handle the response: Once the code is fixed, you can process the response by accessing the `realImageUrl` variable, which contains the URL of the uploaded image. Please note that the code provided is a placeholder and further discussion is required to determine the exact price and timeline for fixing the code. We would be happy to discuss your requirements in more detail and provide you with a tailored solution. You can check...
$20 USD dalam 15 hari
5.0 (5 ulasan)
5.2
5.2
Avatar Pengguna
I can help you with this______________________________Connect to me in chats______________________________________
$18 USD dalam 7 hari
5.0 (1 ulasan)
0.4
0.4
Avatar Pengguna
Hello. I'm an experienced VB.NET developer with over 7 years of expertise in asynchronous programming and API integration. I am confident that I can help you resolve the issue with your code. To clarify the requirements, I kindly request the following information: 1. Are there any specific error messages or exceptions you're encountering when the response is false? 2. Can you provide details about the API you are trying to interact with and any specific requirements it has? 3. Have you checked the API documentation to ensure the endpoint and authentication details are correct? 4. Would you like any additional error handling or logging incorporated into the code? Let's have a quick chat session to discuss and debug the issues thoroughly. I look forward to connecting with you to ensure the successful execution of your image upload functionality.
$25 USD dalam 1 hari
0.0 (0 ulasan)
0.0
0.0

Tentang klien

Bendera SOUTH AFRICA
Johannesburg, South Africa
5.0
63
Kaedah pembayaran disahkan
Ahli sejak Sep 3, 2004

Pengesahan Klien

Terima kasih! Kami telah menghantar pautan melalui e-mel kepada anda untuk menuntut kredit percuma anda.
Sesuatu telah berlaku semasa menghantar e-mel anda. Sila cuba lagi.
Pengguna Berdaftar Jumlah Pekerjaan Disiarkan
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuatkan pratonton
Kebenaran diberikan untuk Geolocation.
Sesi log masuk anda telah luput dan telah dilog keluar. Sila log masuk sekali lagi.