Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Web Services

Reply
Contributor
cmolkentine
Posts: 14
Registered: ‎04-26-2013
My Device: Blackberry z10
Accepted Solution

Blackberry Web Service email profile, activation password, user deletion

Hello,

 

Working on setting up automated provisioning in our environment and having a bit of difficulty of setting up the portions of assigning a user email profile, activation password, and user deletion with only removing organization data.   I am finding it difficult to find code that is designed for BDS 6.2.  Can anyone provide example code of these to assist us in getting this done as quickly as possible.

 

 

Thank you,

Charles Molkentine

United Healthgroup IT

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Blackberry Web Service email profile, activation password, user deletion

Hi Charles,

 

All of the supported BWS calls are accompanied with code snippets:

http://www.blackberry.com/developers/docs/bds/bws/enterprise/admin/6.2.0.35/

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
cmolkentine
Posts: 14
Registered: ‎04-26-2013
My Device: Blackberry z10

Re: Blackberry Web Service email profile, activation password, user deletion

Hi Garett,

 

We have gone over the site, but are unable to create code to set a users email profile.   We have tried a few things are getting stuck.

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Blackberry Web Service email profile, activation password, user deletion

I don't see any method available to set this, what specifically are you trying to achieve?

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
cmolkentine
Posts: 14
Registered: ‎04-26-2013
My Device: Blackberry z10

Re: Blackberry Web Service email profile, activation password, user deletion

We have an email profile called ActiveSync.  After user creation we want it to add that email profile via the Web Services API.  Once that is done we also want it to set an activation password for the user to get their device activated.   We also need code for when an employee is terminated to delete their account and wipe only orginizational data.

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Blackberry Web Service email profile, activation password, user deletion

Ok, one issue at a time. Asking 3 separate questions in 1 thread leads to confusing questions and answers.

 

Set ActivationPassword:

http://www.blackberry.com/developers/docs/bds/bws/enterprise/admin/6.2.0.35/com/rim/ws/enterprise/ad...

 

Delete User:

http://www.blackberry.com/developers/docs/bds/bws/enterprise/admin/6.2.0.35/com/rim/ws/enterprise/ad...

 

Both of the above were found by searching the same page for the calls you said you wanted to make.

 

The email profiles was a bit tricky, the call is to createUserEmailProfiles, you need to have the user already created then retrieve the user via getUsers, pass the User object into the below call:

http://www.blackberry.com/developers/docs/bds/bws/enterprise/admin/6.2.0.35/com/rim/ws/enterprise/ad...

Garett
@garettBeuk
--
Goodbye everybody!
New Contributor
shyamalvaidya
Posts: 7
Registered: ‎04-26-2013
My Device: z10

Re: Blackberry Web Service email profile, activation password, user deletion

Hello,

 

So could you please give us the step by step instruction, by doing to the API instruction point, Its not helping us and we will be ending up wasting whole day.

I am struggling at this point

 

createUserEmailProfilesRequest.NewUserEmailProfiles().add(newUserEmailProfile);

 

Its not working for me in C#, So please suggest how to call with request call.

 

Thanks

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Blackberry Web Service email profile, activation password, user deletion

Please be more specific, what in particular is not working?

Could you provide code snippets of what you have already?

 

Help me help you.

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
cmolkentine
Posts: 14
Registered: ‎04-26-2013
My Device: Blackberry z10

Re: Blackberry Web Service email profile, activation password, user deletion

Trying to convert the sample

CreateUserEmailProfilesRequest request =newCreateUserEmailProfilesRequest();
   request
.setMetadata(metadata);        

   
NewUserEmailProfile newUserEmailProfile =newNewUserEmailProfile();
   
// "user" was returned from getUsers() API
   newUserEmailProfile
.setUser(user);
   
// "emailProfile" was returned from getEmailProfiles() API
   newUserEmailProfile
.setEmailProfile(emailProfile);

This is what I have so far.  Sorry not the greatest at coding.  I am just trying to assist Shyamal who is doing the coding.
CreateUserEmailProfilesRequest request = newCreateUserEmailProfilesRequest();

 

NewUserEmailProfile newuserEmailProfile = newNewUserEmailProfile();

newuserEmailProfile.user(GetUsersResponse);  <- this part I am having issues with converting.

New Contributor
shyamalvaidya
Posts: 7
Registered: ‎04-26-2013
My Device: z10

Re: Blackberry Web Service email profile, activation password, user deletion

  public static void sample() {
   //create the request object

           

   CreateUserEmailProfilesRequest createUserEmailProfilesRequest = new CreateUserEmailProfilesRequest();
   createUserEmailProfilesRequest.metadata = Metadata;        

            //createUserEmailProfilesRequest.newUserEmailProfiles =

          
        
   NewUserEmailProfile newUserEmailProfile = new NewUserEmailProfile();
   // "user" was returned from getUsers() API
            
   newUserEmailProfile.user = User;
   // "emailProfile" was returned from getEmailProfiles() API
   newUserEmailProfile.emailProfile = EmailProfile;

   // user-specific email profile settings
   newUserEmailProfile.accountName = "svaidy8";
  // newUserEmailProfile.domainName = "MS";
   newUserEmailProfile.emailAddress = "shyamal_vaidya@uhc.com";
   newUserEmailProfile.password = "abc123";
   newUserEmailProfile.username = "svaidy8";

             // CreateUsersRequest createUsersRequest = new CreateUsersRequest();
  

//request1.newUserEmailProfiles = newUserEmailProfile;
   //request1.newUserEmailProfiles[0].emailProfile = EmailProfile;
   //request1.newUserEmailProfiles[0].accountName = "svaidy8";
   //request1.newUserEmailProfiles[0].emailAddress = "shyamal_vaidya@uhc.com";
   //request1.newUserEmailProfiles[0].password = "sadasd";
   //         request1.newUserEmailProfiles[0].username = "svaidy8";
   //         request1.newUserEmailProfiles[0].user = User;


   createUserEmailProfilesRequest.NewUserEmailProfiles.add(newUserEmailProfile);
CreateUserEmailProfilesResponse CreateUserEmailProfilesResponse = bwsService.createUserEmailProfiles(createUserEmailProfilesRequest);
           

            

// createUserEmailProfilesRequest.newUserEmailProfiles = newUserEmailProfile.
// createUserEmailProfilesRequest.add(newUserEmailProfile);

//   CreateUserEmailProfilesResponse createUsersResponse = bws.createUserEmailProfiles(createUserEmailProfilesRequest);

//   if (createUsersResponse.returnStatus.getCode().compareTo("SUCCESS") != 0) {
//      // System.out.println("Error occured: " + createUsersResponse.getReturnStatus().getCode());
//   }

            

//   foreach (IndividualResponse itr in response.createUsersResponse) {
//       if (itr.returnStatus.getCode().compareTo("SUCCESS") !=0 ) {
//          // System.out.println("Individual responses - Code: " + itr.ReturnStatus().getCode() + " Message: " + itr.getReturnStatus().getMessage());
//       }
//       else {
//         //  System.out.println("User email profile created. Uid is: " + itr.getUid());
//       }
//   }
}

 So I am try to get

createUserEmailProfilesRequest.NewUserEmailProfiles.add(newUserEmailProfile);

 

but it says NewUserEmailProfiles is not a part of createUserEmailProfilesRequest. I have added all attricutes in NewUserEmailProfile, just need to add them to the request.