brittonsm213
New Member
- Joined
- Jan 4, 2016
- Messages
- 2
I've been searching the boards, but still can't seem to find an answer to why this doesn't work. The authentication works, but when I then try to query the part number I get - "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Draft//EN"><HTML>
<HEAD>
<TITLE>Error 500--Internal Server Error</TITLE>
</HEAD>
<BODY bgcolor="white">
<FONT FACE=Helvetica><BR CLEAR=all>
<TABLE border=0 cellspacing=5><TR><TD><BR CLEAR=all>
<FONT FACE="Helvetica" COLOR="black" SIZE="3"><H2>Error 500--Internal Server Error</H2>
</FONT></TD></TR>
</TABLE>
<TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Courier New"><FONT FACE="Helvetica" SIZE="3"><H3>From RFC 2068 <i>Hypertext Transfer Protocol -- HTTP/1.1</i>:</H3>
</FONT><FONT FACE="Helvetica" SIZE="3"><H4>10.5.1 500 Internal Server Error</H4>
</FONT><P><FONT FACE="Courier New">The server encountered an unexpected condition which prevented it from fulfilling the request.</FONT></P>
</FONT></TD></TR>
</TABLE>
</BODY>
</HTML>"
Here is the simple code I'm trying... And yes I know the account works, as I'm able to paste these into a IE address bar and get an XML return.
Thanks!
Public Sub Silicon_Experts_API()
strURL = "https://app.siliconexpert.com/SearchService/search/authenticateUser?login=MYACCOUNTHERE&apiKey=MYKEYHERE"
Set xmlHttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")
xmlHttp.Open "GET", strURL
xmlHttp.setRequestHeader "Content-Type", "text/xml"
xmlHttp.send
'Save the response to a string
strReturn = xmlHttp.responseText
strURL = "https://app.siliconexpert.com/SearchService/search/listPartSearch?partNumber=[{" & Chr(34) & "partNumber" & Chr(34) & ":" & Chr(34) & "bav99wt" & Chr(34) & "},{" & Chr(34) & "partNumber" & Chr(34) & ":" & Chr(34) & "bav99" & Chr(34) & "}]&mode=beginwith&pageNumber=1&fmt=xml"
xmlHttp.Open "GET", strURL
xmlHttp.setRequestHeader "Content-Type", "text/xml"
xmlHttp.send
'Save the response to a string
strPartInfo = xmlHttp.responseText
Debug.Print strPartInfo
End Sub
<HEAD>
<TITLE>Error 500--Internal Server Error</TITLE>
</HEAD>
<BODY bgcolor="white">
<FONT FACE=Helvetica><BR CLEAR=all>
<TABLE border=0 cellspacing=5><TR><TD><BR CLEAR=all>
<FONT FACE="Helvetica" COLOR="black" SIZE="3"><H2>Error 500--Internal Server Error</H2>
</FONT></TD></TR>
</TABLE>
<TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Courier New"><FONT FACE="Helvetica" SIZE="3"><H3>From RFC 2068 <i>Hypertext Transfer Protocol -- HTTP/1.1</i>:</H3>
</FONT><FONT FACE="Helvetica" SIZE="3"><H4>10.5.1 500 Internal Server Error</H4>
</FONT><P><FONT FACE="Courier New">The server encountered an unexpected condition which prevented it from fulfilling the request.</FONT></P>
</FONT></TD></TR>
</TABLE>
</BODY>
</HTML>"
Here is the simple code I'm trying... And yes I know the account works, as I'm able to paste these into a IE address bar and get an XML return.
Thanks!
Public Sub Silicon_Experts_API()
strURL = "https://app.siliconexpert.com/SearchService/search/authenticateUser?login=MYACCOUNTHERE&apiKey=MYKEYHERE"
Set xmlHttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")
xmlHttp.Open "GET", strURL
xmlHttp.setRequestHeader "Content-Type", "text/xml"
xmlHttp.send
'Save the response to a string
strReturn = xmlHttp.responseText
strURL = "https://app.siliconexpert.com/SearchService/search/listPartSearch?partNumber=[{" & Chr(34) & "partNumber" & Chr(34) & ":" & Chr(34) & "bav99wt" & Chr(34) & "},{" & Chr(34) & "partNumber" & Chr(34) & ":" & Chr(34) & "bav99" & Chr(34) & "}]&mode=beginwith&pageNumber=1&fmt=xml"
xmlHttp.Open "GET", strURL
xmlHttp.setRequestHeader "Content-Type", "text/xml"
xmlHttp.send
'Save the response to a string
strPartInfo = xmlHttp.responseText
Debug.Print strPartInfo
End Sub