Search Cloud One – Basic
API for Sub Account Management 1.0
The Sub Account Management endpoint (/SubAccountMgmt) is the endpoint where the master account holder can view and manage sub-users of their account.
The Endpoint accepts requests of contentType application/json only.
All requests must pass a valid APIKey. A Valid API Key is one that is either a ‘Master Account’ API Key, or an ‘API User’ Key where the given key has ‘Manage Users’ Permission. Organization MemberKeys are not valid.
All requests must pass a valid Action. There are three possible actions that can be passed:-
ListAccounts Retrieve a list of accounts belonging to the master account holder.GetSubPerms Retrieve the permissions assigned to a sub account.CreateAccount Create an API User or Organization Member account.ListAccountsRequires no extra JSON parameters. Responds with a list of sub accounts tied to the master account, with their UserID, UserUUID, UserName, DisplayName and UserType.
See: UserTypes (TODO)
In the case that UserType is APIUser, DisplayName and UserName are the same.
{
"APIKey": "7e41ef06-6c0e-477e-b7e4-3103fc41fef2",
"Action": "ListAccounts"
}
{
"SubAccounts": [
{
"UserID": "251",
"UserUUID": "b611e40a-914e-45ce-b83e-6e752722ab71",
"UserName": "john_smith27",
"DisplayName": "John Smith",
"UserType": "OrgMember"
},
{
"UserID": "346",
"UserUUID": "0df0c143-6c24-4c14-8b1b-7d6dcbffe8c7",
"UserName": "Android App",
"DisplayName": "Android App",
"UserType": "APIUser"
}
]
}
GetSubPermsRequires UserID and UserUUID to be passed. Brings back whether or not the user is a master account, if it can along with an array of IndexPermissions.
{
"APIKey": "7e41ef06-6c0e-477e-b7e4-3103fc41fef2",
"Action": "GetSubPerms",
"UserID": "56462",
"UserUUID": "19adb403-5c87-4ab9-8df1-12965069acd9"
}
{
"IsMaster": false,
"IndexPermissions": [
{
"IndexID": "3512",
"IndexUUID": "d2d9cbb5-63f1-4b87-b377-424d95fef0b9",
"Read": true,
"Write": true,
"Delete": false,
"AlterProperties": false
},
{
"IndexID": "4657",
"IndexUUID": "e53910af-92da-4986-bb5b-f178c08066aa",
"Read": true,
"Write": false,
"Delete": false,
"AlterProperties": false
}
]
}
CreateAccountRequires an AccountType and Username to be passed.
AccountType can be one of two types:
OrgMember – For members of an organization who would login through the SearchCloudOne Management Console.
Email and DisplayName.Username must be a username that is unique to SearchCloudOne.Users or API page.APIUser – An account used by programs (For instance, a Search Page on a Website, or an application).
Username can be any name unique to your account with any format.{
"APIKey": "0cf08d1d-7da5-4fa8-8fa1-c5bbe12e0bbf",
"Action": "CreateAccount",
"Username": "Android App",
"AccountType": "APIUser"
}
{
"APIKey": "0cf08d1d-7da5-4fa8-8fa1-c5bbe12e0bbf",
"Action": "CreateAccount",
"Username": "john_smith27",
"DisplayName": "John Smith",
"AccountType": "OrgMember",
"Email": "john.smith@example.com"
}
No Response Body will be sent. Check the Response Status Code for success:
200 OK The account was created successfully.409 Conflict The passed Username is already taken. Try another.412 Precondition Failed Required fields are missing from the request401 Unauthorized Passed an Invalid API Key (Expired or does not have permission to create a sub account)400 Bad Request The passed AccountType was not recognized. (Case Sensitive)