Unread topics or posts
Unread topics or posts
Toodledo API and Visual Basic
I'd like to transfer info between Toodledo and an activity tracking module that I've developed.
I've done some Visual Basic programming but I've never used REST or any web services. I've read the Toodledo Developer's API and it seems quite straightforward except for initiating the connection with the Toodledo server.
Is there some sample VB code that I can use as a starting point, perhaps something that includes wrappers for the API calls?
Sorry for the late response. Try this code
Public Class Web
Public Shared Function GetAPIResponse(ByVal url As String) As String
Dim result As String = String.Empty
'TODO add proxy support here
Dim request As WebRequest = WebRequest.Create(url)
Using response As HttpWebResponse = request.GetResponse()
Using sr As StreamReader = New StreamReader(response.GetResponseStream())
result = sr.ReadToEnd()
Catch ex As Exception
Throw New Exception("Error requesting URL" & url, ex)
Unfortunately, I don't understand how your code snippet fits into my sample application.
For now, I'm experimenting with a VB application that consists of one form with one button and one textbox, and I want to attach code to the button's click event that will add a Toodledo task with the name specified in the textbox.
(Later, I will add code that will get the task data from an SQL database.)
I would appreciate any help you can provide to get me started, including just pointing me in the right direction.
(Almost all of my VB experience is related to manipulating local and LAN-based data. I have practically no experience with Web-based applications or data.)
The Toodledo API is REST based, which means that all operations are performed using URL based commands.
You would use this code to send a URL command to the web site API and retrieve a response.
For example, the first operation you need to perform when using the API is to get a session token. This operation is performed using the following URL
After adding the above code to your application, you would achieve this as follows
Dim request as String
Dim result as String
result = Web.GetAPIResponse(request)
and result would contain the response from the web site
hope that helps
The main issue was how to incorporate your sample code into a VB Form Application. Other issues were how to parse the session token and how to create a 32-character hash.
I've now figured out the basics.
To participate in these forums, you must be signed in.