HTTP POST API Using Excel/VBA

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.ย. 2024

ความคิดเห็น • 24

  • @user-qs7cy5of5z
    @user-qs7cy5of5z 2 ปีที่แล้ว +1

    Amazing video, thank you
    It helps me a lot....

  • @prasenjitmandal5486
    @prasenjitmandal5486 2 ปีที่แล้ว +1

    Amazing ! Keep Going

  • @josepablobarrantes178
    @josepablobarrantes178 2 ปีที่แล้ว +1

    Thank you bro!! Great video!!

  • @DiveSouthFlorida
    @DiveSouthFlorida 3 ปีที่แล้ว +1

    Thank you for your video for the " question just use double quote as escape character . Ex:
    newbody = "{""data"": {""include"": [""notes"", ""projects"", ""subtasks"" ], ""name"": ""New Task Name"" }}"

    • @rajasharma5255
      @rajasharma5255  3 ปีที่แล้ว

      Thanks Javier. Will update and try !!!

  • @mrganesh123100
    @mrganesh123100 4 ปีที่แล้ว +1

    Thank you for the video. For ":" Please Use Chr(58)

  • @englanddg6227
    @englanddg6227 ปีที่แล้ว +1

    Double quotes in VBA = ""
    So, if you want a double quote in your string, you'd ""
    String1 = "Begin String"
    String2 = "End String"
    Example = String1 & " stuff ""in double quotes""" & String2
    msgbox Example
    prints as:
    Begin String stuff "in double quotes" End String

  • @manikandanu2317
    @manikandanu2317 4 หลายเดือนก่อน

    Great

  • @Friedena
    @Friedena 9 หลายเดือนก่อน

    Thanks for the vid. I see this is JSON data. How do we do it for XML? Also, how to handle securing with client authentication, a .jks file for example?

  • @Raimkhodzhanov
    @Raimkhodzhanov ปีที่แล้ว

    Thak You!

  • @rahulbanerjee5288
    @rahulbanerjee5288 5 หลายเดือนก่อน

    The security validation for this page is invalid and might be corrupted. Please use your web browser's Back button to try your operation again. getting this error. Can you help ion this

    • @rajasharma5255
      @rajasharma5255  5 หลายเดือนก่อน

      Are you using Google Sheets ? What I'm using is MSExcel. When doing this on Google sheets, there are some plug-ins and added security that needs to be added. I'm sure you can Google it. If not, let me know. I can look into this for you.

  • @1malditoPerro
    @1malditoPerro ปีที่แล้ว

    I'm using excel 2013 and I'm trying to get rapidapi to work with it I've been at it for hours and cant get the send part to work. Please help

  • @MartinQMusic
    @MartinQMusic 3 ปีที่แล้ว +1

    I just got this error
    {"Errors":[{"Id":0,"Code":"Required","Message":"Required","ResourceKey":"Required","ResourceFormatString":null,"ResourceFormatString2":null,"PropertyName":"Request"}],"SearchResults":null}
    Can you support me?

    • @rajasharma5255
      @rajasharma5255  3 ปีที่แล้ว

      Would you be able to post ur code?

    • @MartinQMusic
      @MartinQMusic 3 ปีที่แล้ว +1

      @@rajasharma5255 100%
      Sub BasicPostRequest()
      Dim req As New MSXML2.ServerXMLHTTP60
      Dim env As String
      Dim ReqURL As String
      Dim allbody As String
      Dim newbody As String
      Dim RESPONSE As String
      Range("V1").Value = " "
      newbody = Range("U1").Value
      allbody = "{" + newbody + "}"
      ReqURL = "api.mouser.com/api/v1/search/keyword?apiKey=(Here suppose to be the API key)"
      req.Open "POST", ReqURL, False
      req.setRequestHeader "accept", "application/json"
      req.setRequestHeader "Content-Type", "application/json"
      req.send allbody
      RESPONSE = req.responseText
      If req.Status 200 Then
      MsgBox req.Status & " - " & req.statusText
      Range("V1").Value = RESPONSE
      Exit Sub
      End If

      Range("V1").Value = RESPONSE
      End Sub
      In the consolidated data of the U1 value, there is the next information
      "Keyword":"SMUN5214T1G","records":"0","startingRecord":"0","searchOptions":"string","searchWithYourSignUpLanguage":"string",
      the API information is in this link
      api.mouser.com/api/docs/ui/index#/
      and the curl info is that one
      curl -X POST "api.mouser.com/api/v1/search/keyword?apiKey=(Here suppose to be the API key)" -H "accept: application/json" -H "Content-Type: text/json" -d "{ \"SearchByKeywordRequest\": { \"keyword\": \"SMUN5214T1G\", \"records\": 0, \"startingRecord\": 0, \"searchOptions\": \"string\", \"searchWithYourSignUpLanguage\": \"string\" }}"
      request url
      api.mouser.com/api/v1/search/keyword?apiKey=(Here suppose to be the API key)
      I DO APPRECIATE YOUR HELP MAN!

    • @rajasharma5255
      @rajasharma5255  3 ปีที่แล้ว

      @@MartinQMusic Will run and get back to you as soon as I can.

    • @rajasharma5255
      @rajasharma5255  3 ปีที่แล้ว

      @@MartinQMusic Make sure you have the "SearchByKeywordRequest" identifier in the call as well
      {
      "SearchByKeywordRequest": {
      "keyword": "SMUN5214T1G",
      "records": 0,
      "startingRecord": 0,
      "searchOptions": "string",
      "searchWithYourSignUpLanguage": "string"
      }
      This should be part of the call. So in your U1 value, validate that you have the "SearchByKeywordRequest" identifier.

  • @ignaciosojo8135
    @ignaciosojo8135 ปีที่แล้ว

    CHAR(34)?

  • @johnywhy4679
    @johnywhy4679 2 ปีที่แล้ว

    In American, a better way to say "allbody" is "everybody". A better way to say "newbody" is "nobody".
    Just kidding! :D