Add users

The API provides the function of inviting user into integrator account.

Source Code Sample

JSONObject jsonData = new JSONObject();
JSONArray userinfos = new JSONArray();
JSONObject user1 = new JSONObject();
		 
user1.put("email", "apiadduser1@yopmail.com");
user1.put("roletype", "1");
user1.put("phonesn", "");
user1.put("name","");
userinfos.add(user1);
	     
user2.put("email", "apiadduser2@yopmail.com");
user2.put("roletype", "0");
userinfos.add(user2);

jsonData.put("users", userinfos);

data = Hex.encodeHexString(Utils.aesEcbPkcs5PaddingEncrypt(jsonData.toString(), apiSecret));
mac = Utils.calculateMac(data, apiSecret);

Request Body Creation

{
"users":[{
    	"email": "apiadduser1@yopmail.com",
        "phonesn": "",
        "name": "",
        "roletype": "1" },
        {
	    "email": "apiadduser2@yopmail.com",
        "roletype": "0"
        }]
}

Example of Request

https://<domain>/signserver/v1/account/addusers?accesstoken=2bb0417a-a409-4c80-8d9b-3b138e04f8&data=1dc5c5d3b8d22178acf393334400325c5ec5a6a4f21352ef5dbb5eadd96ae1d1e4872&mac=97081bf511393cad45b0bebde8543e3d189a0ff219fe2ad9c0f42667723301f5

Expected Response

{
    	“message”: “User(s) added successfully.”, 
    	“users”: [“apiadduser1@yopmail.com”, “apiadduser2@yopmail.com”]
}

How can we help?