VB.Net

Begin by creating a Web Service reference to the API located at http://servername/ESD/api.asmx.

Example: Connect to the Web Service

Dim SSAPI As New AppPortalAPI.API

 

'Specify the URL to your particular server

SSAPI.Url = "http://ws07/esd/api.asmx"

 

'This is important to have if you are using your own credentials

'SSAPI.UseDefaultCredentials = True

 

'Or if you use an account

SSAPI.Credentials = New NetworkCredential("User", "Password", "Domain")

Example: Create a New Software Request

Dim oRequestID As Object = SSAPI.createRequest(846, "NewPCName3", "SMX\John", "SMX\John", True, False, New String() {})

 

If IsNumeric(oRequestID) Then

 

    Console.WriteLine("Successfully created RequestID {0}", CInt(oRequestID))

 

Else

 

    Console.WriteLine("Problem submitting request: {0}", oRequestID.ToString)

 

End If

Example: Import a New Computer Object

Dim iResult As Integer = SSAPI.importComputer("NewPCName3", "SMX", "", "", "00:00:00:00:00:00", "", "")

 

Example: Approve request

Dim iResult As Integer = SSAPI.approveRequest(81972, "API Approval", "Approved via API", "SMX\John", "")

 

If iResult = 1 Then

 

    Console.WriteLine("Successfully Approved RequestID {0}", 81972)

 

End If