com.route4me.sdk.examples.users.CreateUser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of route4me-java-sdk Show documentation
Show all versions of route4me-java-sdk Show documentation
>This SDK makes it easier for you use the Route4Me API, which creates optimally sequenced driving routes for many drivers.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.route4me.sdk.examples.users;
import com.route4me.sdk.exception.APIException;
import com.route4me.sdk.services.routing.Constants;
import com.route4me.sdk.services.users.User;
import com.route4me.sdk.services.users.UsersManager;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author juan
*/
public class CreateUser {
public static void main(String[] args) {
String apiKey = System.getenv("R4M_API_KEY");
User user = new User();
user.setMemberFirstName("Clay");
user.setMemberLastName("Abraham");
user.setMemberEmail("[email protected]");
user.setMemberPassword("123456Secret");
user.setDateOfBirth("1978");
user.setMemberPhone("571-22-5555");
user.setMemberZipcode("22102");
user.setMemberType(Constants.MemberType.SUB_ACCOUNT_DRIVER.toString());
user.setHideRoutedAddresses(Constants.MemberPropertyValue.FALSE.toString());
user.setHideVisitedAddresses(Constants.MemberPropertyValue.FALSE.toString());
user.setReadonlyUser(Constants.MemberPropertyValue.FALSE.toString());
UsersManager manager = new UsersManager(apiKey);
try {
user = manager.createUser(user);
} catch (APIException ex) {
Logger.getLogger(CreateUser.class.getName()).log(Level.SEVERE, null, ex);
}
System.out.println(user);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy