PDA

View Full Version : Send data from excel with API (XMLHTTP in VBA)



tuneon
10-03-2016, 10:11 AM
I'll be more than happy if you can help me with this issue.
Today I'm using chrome extension "POSTMAN" when I'm sending API leads to Brand's CRM I'm sending API http post\get one by one.
In "POSTMAN" or any other http rest you can't send more then 1 request at a time (correct me if I'm wrong)
How can I send a few API http requests from excel file in VBA or is there an easy way to do that?(I know i shuold use XMLHTTP in VBA but i dont know how to to it.)

Thanks again.

snb
10-03-2016, 12:55 PM
Too little information; I have no idea what you are talking about.

tuneon
10-03-2016, 01:34 PM
Sorry if this information was not explain probably.
I need to send data form excel to API with user name and password + mendetory fields in http post\get.
Please help me with an example of code in VBA for this issue.
Hope my explanation was understand.
Thanks for all.

offthelip
10-03-2016, 02:45 PM
You need to do something like this:
although this doesn't sort out the user name and password it might get you started.

Sub test()
Set FinHTTP = CreateObject("Microsoft.xmlHTTP")
urlstring = "your_url_string"
FinHTTP.Open "GET", urlstring, False
FinHTTP.send
End Sub

tuneon
10-04-2016, 01:42 AM
You need to do something like this:
although this doesn't sort out the user name and password it might get you started.

Sub test()
Set FinHTTP = CreateObject("Microsoft.xmlHTTP")
urlstring = "your_url_string"
FinHTTP.Open "GET", urlstring, False
FinHTTP.send
End Sub




Ok, its a good start mate thanks! I'm using a post method.
1. How do I insert the user name and password ?
2.how do I insert the strings for name, phone , and email.....
3. How do I import the info for the excel file ?
Thanks again for your time and effort.