Go Back   CHECKBOX® Online Community > Checkbox® > CHECKBOX® Developer Kit

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-05-2008, 01:29 PM
leeg32
Guest
 
Posts: n/a
Default Sending an Invitation for a Survey

Hey, I'm currently working on a vb.net page where I want to do the following through the webservice/API.:

1. Confirm if a user exists. If he exists, then get the details for the user (guidUserID).
2. If the user doesn't exist, create the user and get the details stored along with the guidUserID.
3. Finally, fire off an invitation to the existing or newly created user for a particular survery. The survey will have already been created using the Checkbox Survey Server web pages in advance.

For steps 1 and 2, I believe I'm pretty much there using the webservice. It's when I get to step 3 where I'm bogging down. I know there is an older example of doing this from another post. That post is written in C# and doesn't appear to be using the webservice. I'm unable to get valid references for that other code to work correctly. Here's what I have below in regards to my code. Thoughts on the solution anyone?

Dim objInvitation As Checkbox.Web.Services.InvitationManagement
Dim guidUserToken As Guid
Dim guidUserID As Guid
Dim test As String()
Dim value As String
Dim profileProps As New List(Of SimpleNameValue(Of Object, Object))()
Dim profile As SimpleNameValue(Of Object, Object)()
Dim strCurrentEmail As String



wsProxy.Url = "http://localhost/checkbox/services/usermanagementservice.asmx"

guidUserToken = wsProxy.AuthenticateUser("admin", "admin")

If guidUserToken <> Guid.Empty Then
'test = wsProxy.GetUserIdentities(guidUserToken, "UserName", "TestUser")
'Response.Write(test(0))
'Create the profile for the new user


profileProps.Add(New SimpleNameValue(Of Object, Object)("FirstName", "Test"))
profileProps.Add(New SimpleNameValue(Of Object, Object)("LastName", "Test"))
profileProps.Add(New SimpleNameValue(Of Object, Object)("Email", "test@domain.com"))
'Create the user
wsProxy.CreateUser(guidUserToken, "Test", "password", profileProps.ToArray(), True)

profile = wsProxy.GetUserProfile(guidUserToken, "Test")

'Find the "LastName" property and update it
For Each profileProp As SimpleNameValue(Of Object, Object) In profile

'Response.Write("Name: " & profileProp.Name.ToString() & " ")
'Response.Write("Value: " & profileProp.Value.ToString & "
")

If DirectCast(profileProp.Name, String) = "Email" Then
strCurrentEmail = profileProp.Value.ToString()
Response.Write(strCurrentEmail)

End If
Next
End If

'this is the point where I would need code for firing off a survey
objInvitation.AddUsersToInvitation(

end sub
Reply With Quote
  #2 (permalink)  
Old 03-05-2008, 01:40 PM
Senior Member
 
Join Date: Mar 2007
Posts: 194
Default

The example for sending an invitation does not use WebServices because at this time there is no WebService for invitation management. The invitation WebService is scheduled to be released with Checkbox 4.5, which we hope to have out in the next month or two.

At this time the only way to send an invitation is using the API. An example of how to accomplish this is outlined in the forum post you mentioned.
Reply With Quote
  #3 (permalink)  
Old 03-05-2008, 01:50 PM
leeg32
Guest
 
Posts: n/a
Default

I'm unable to access the following when trying to establish references based on the other post. Which dll should I be using in order to access this? Is it checkbox.dll or does it involve others as well?


Imports Checkbox.Users
Imports Checkbox.Forms
Imports Checkbox.Panels
Imports Checkbox.Security
Imports Checkbox.Invitations
Imports Checkbox.Messaging.Email

....
I figured this out. I added the checkbox.dll which also adds several other dependency dlls. The import statements are now good. However, there seems to be issues with the conversion from C# to vb.net. I'll post those issues in the original thread from July.

Last edited by leeg32; 03-05-2008 at 01:59 PM. Reason: found dll.
Reply With Quote
  #4 (permalink)  
Old 03-05-2008, 02:15 PM
Senior Member
 
Join Date: Mar 2007
Posts: 194
Default

You will need to add a reference to the Checkbox.dll. You may want to add Checkbox.Common.dll, Prezza.Framework.dll and Prezza.Framework.Common.dll as well.

I apologize for the redundant response. I only receive an email notification for new posts not edits.

Last edited by pwiesner; 03-05-2008 at 02:19 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 09:17 PM.


SEO by vBSEO 3.2.0