Page 1 of 1

Need some help getting started

Posted: Wed Nov 06, 2013 6:34 am
by rflud
Can anyone help me get started? I am trying to get a connection to the web API for Autotask. I'd like to just make a simple stack with a login button and then a query button with an output list. I have all of the sample code to make this happen but I'm unsure how to get going in LC. For some reason the forum won't let me post the code. I can send it to you. Thanks in advance.

Re: Need some help getting started

Posted: Wed Nov 06, 2013 3:09 pm
by dunbarx
Hi.

I seem to remember that there is a minimum number of posts required before you can attach a file, but do not think there is one preventing you from using the "

Code: Select all

" tags. If I am wrong, though, simply post it in the clear, as text.

Craig Newman

Re: Need some help getting started

Posted: Wed Nov 06, 2013 4:53 pm
by rflud
Thanks. No matter if it's plain text or within the "code" I get this when I try to post - Your account does not have permission to post links or domain/page references.

Re: Need some help getting started

Posted: Wed Nov 06, 2013 5:49 pm
by dunbarx
But you are posting already. Did you mean you could not attach a file when you said you could not post "code"?

Craig

Re: Need some help getting started

Posted: Wed Nov 06, 2013 5:52 pm
by rflud
I can post regular text but if I try to put in the sample code I have it gives me this error when I try to click to submit. I can just email it to you if you'd like.

Re: Need some help getting started

Posted: Wed Nov 06, 2013 10:20 pm
by Simon
There is a URL in rflud code.
Can't post it yet or change the url to w w w . s o m e. c o m (spaces between the letters).

Simon

Re: Need some help getting started

Posted: Wed Nov 06, 2013 10:25 pm
by rflud
I found the lines that were causing the problem. I noted them with "**************" I had to add a space after the periods and break up the URL.

Dim strWebURI As String = "h t t p s: / / webservices5 . autotask . net / atservices / 1 . 5 / atws . wsdl" *******************
Dim myService As New WebReference.ATWS
myService.Url = strWebURI
Dim cred As New System. Net. NetworkCredential("myUserName at domain . com", "myPassword") *******************
Dim credCache As New System. Net. CredentialCache ***********************
credCache.Add(New Uri(myService.Url), "Basic", cred)
myService.Credentials = credCache

and here is the code to run a query for accounts.

Dim boolQueryFinished = False
Dim strCurrentID As String = "0"
While Not (boolQueryFinished)
Dim strQuery As String = "<queryxml><entity>Account</entity>" & _
"<query><field>id<expression op=""greaterthan"">" & strCurrentID & "</expression></
field></query>" & _
"</queryxml>"
Dim r As myWS.ATWSResponse
r = myService.query(strQuery)
If r.EntityResults.Length > 0 Then
For Each ent As myWS.Entity In r.EntityResults
' execute some code on the current account
Console.WriteLine(CType(ent, myWS.Account).AccountName)
Console.WriteLine(ent.id)
strCurrentID = ent.id
Next
Else
boolQueryFinished = True
End If
End While

Re: Need some help getting started

Posted: Thu Nov 07, 2013 10:35 pm
by rflud
Can anyone turn this code into a working stack? Or at least point me in the right direction?