Hi,
Been having a nightmare with this authentication in a desktop application.
Finally decided to implement just the 2nd part of the authentication using
the token only, I thought this would be more straight forward, but
apparently not.
Dim request As HttpWebRequest =
WebRequest.Create(“https://api.sandbox.freeagent.com/v2/company”)
request.Headers.Add(“Authorization”, "OAuth ")
request.Method = “GET”
request.ContentType = “application/json”
' Send Request & Get Response
Dim response = request.GetResponse()
' Get the Response Stream
Dim reader As StreamReader = New
StreamReader(response.GetResponseStream())
Dim json As String = reader.ReadToEnd()
' Retrieve the Access Token
Dim ser As JavaScriptSerializer = New JavaScriptSerializer()
Dim x As Dictionary(Of String, Object) = ser.DeserializeObject(json)
Dim accessToken As String = x("access_token").ToString()
Should I not just get a json response instead of a bad request or am I
missing something here?
This does work on google playground fine and seems to have the same method
and token etc
Thanks,
Rob