title: Excel VBA, Parsing Response from a HTTP request
body: <p>This feels like it should be really simple but I'm a bit stuck. I want to access an API url using Excel VBA. The API gives me a very simple JSON response containing a load id which is used as a parameter in the calling of another API, the other API isn't a problem because I can get the response in either XML or CSV and parse it into Excel.</p>
  
  <p>API Response:
  {"loadid":"1234567890"}</p>
  
  <p>All I need to extract from this response is the number "1234567890".</p>
  
  <p>This is what I've tried so far:</p>
  
  <pre><code>Sub getLoadID()
  
  Dim loadID As String
  Dim loadIDUrl As String
  loadIDUrl = "blah blah"
  
  proxyServer = Worksheets("Sheet1").Range("A1").Value
  
  Set httpReq = CreateObject("WinHttp.WinHttprequest.5.1")
  
  httpReq.Open "GET", loadIDUrl, False
  
  httpReq.setRequestHeader "Content-Type", "text/xml"
  httpReq.setProxy 2, proxyServer, ""
  httpReq.setTimeouts -1, -1, -1, -1
  httpReq.send request
  
  httpReq.ResponseText = loadID
  Worksheets("Sheet1").Range("A2").Value = loadID
  
  End Sub
  </code></pre>
  
  <p>I've tried to put the whole string into a cell just to make sure that Excel is able to obtain the string from the response but going forward will just be happy to store the value as a variable and not write it to the sheet.</p>
  
  <p>The above code runs with no errors, I just don't get the string in cell A2...</p>
  
  <p>Every time I've searched about parsing JSON using Excel VBA everyone recommends to use external libraries but I'm trying to do this at work so I can't use the external libraries.</p>
  
  <p>Cheers</p>