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"" }}"
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
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?
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
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.
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 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!
@@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.
Amazing video, thank you
It helps me a lot....
Amazing ! Keep Going
Thank you bro!! Great video!!
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"" }}"
Thanks Javier. Will update and try !!!
Thank you for the video. For ":" Please Use Chr(58)
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
Great
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?
Thak You!
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
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.
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
Let me get back to you on this
Still having issues ?
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?
Would you be able to post ur code?
@@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!
@@MartinQMusic Will run and get back to you as soon as I can.
@@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.
CHAR(34)?
In American, a better way to say "allbody" is "everybody". A better way to say "newbody" is "nobody".
Just kidding! :D