Find Jobs
Hire Freelancers

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

$10-30 USD

Publicado há 3 meses

$10-30 USD

Pago na entrega
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 do Projeto: 37481906

Sobre o projeto

6 propostas
Projeto remoto
Ativo há 2 meses

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
6 freelancers are bidding on average $36 USD for this job
Avatar do Usuário
Top 1% in 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: 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 em 3 dias
5,0 (289 avaliações)
Avatar do Usuário
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 em 15 dias
5,0 (5 avaliações)
Avatar do Usuário
I can help you with this______________________________Connect to me in chats______________________________________
$18 USD em 7 dias
5,0 (1 avaliação)
Avatar do Usuário
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 em 1 dia
0,0 (0 avaliações)

Sobre o cliente

Bandeira do(a) SOUTH AFRICA
Johannesburg, South Africa
Método de pagamento verificado
Membro desde set. 3, 2004

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.