API Documentation
1.Authentication
The API uses HTTP Basic Authentication to authenticate requests. Use your ReveSecure service’s API key as the HTTP Username.
Generate the HTTP Password as an HMAC signature of the request. This will be different for each request and must be re-generated each time.
To construct the signature, first build an ASCII string from your request, using the following components:
- date : The current time, formatted as RFC 2822. This must be the same string as the “Date” header.
- method : The HTTP method (uppercase)
- host : hostname of the request(lowercase)
- path : The specific API method’s path
- body : request body
Sample Request Body
POST dashboard.revesecure.com/rest/v1/users
Fri, 08 Dec 2017 17:29:18 -0000 POST dashboard.revesecure.com /rest/v1/users { 'key1' : 'value1', 'key2' : 'value2' }
2.Org Info
GET /rest/v1/organization
Example Response
{ 'ActivationTime': 1498213552544, 'OrgWebsite': 'www.example.com', 'OrgName': 'Demo_Technologies', 'DeactivationTime': 1546214400000, 'ActivationStatus': 'Active' }
3.Billing
GET /rest/v1/billing
Example Response
{ 'PlanType': 'Demo', 'AllowedUserCount': 150, 'AllowedServiceCount': 150, 'CurrentServiceCount': 10, 'CurrentUserCount': 15 }
4.Get All Users
GET /rest/v1/users
Example Response
[ { 'EmailId': 'test1@example.com', 'MobileNumber': '8123465790', 'UserName': 'test1@example.com', 'UserId': '4xc5Ha1OfWaeCaaP32JgVIuEv4vfMDTr', 'CountryCode': 91 }, { 'EmailId': 'test2@example.com', 'MobileNumber': '7894561230', 'UserName': 'test2@example.com', 'UserId': '13H882ITh9PA6v7yScvmwu3cTlMEaWFa', 'CountryCode': 91 } ]
4.1.Get Users In Range
GET /rest/v1/users/{startIndex}/{endIndex}
Example Response
{ 'count': 14, 'details': [ { 'EmailId': 'test1@example.com', 'MobileNumber': '8123465790', 'UserName': 'test1@example.com', 'UserId': '4xc5Ha1OfWaeCaaP32JgVIuEv4vfMDTr', 'CountryCode': 91 }, { 'EmailId': 'test2@example.com', 'MobileNumber': '7894561230', 'UserName': 'test2@example.com', 'UserId': '13H882ITh9PA6v7yScvmwu3cTlMEaWFa', 'CountryCode': 91 } ] }
4.2.Get Details of Specific User
GET /rest/v1/users/{userId}
Example Response
{ 'EmailId': 'test1@example.com', 'MobileNumber': '8123465790', 'UserName': 'test1@example.com', 'hardTokenCount': 1, 'FirstName': 'John', 'UserR2faStatus': 'Enabled', 'LastName': 'Doe', 'CountryCode': 91, 'softTokenCount': 3 }
4.3.Validation User Info Request
POST /rest/v1/validate/user
{ 'ApiKey' : 'zdvsdv97vfv' 'LoginName' : 'root', 'UserName' : 'test1@example.com/uniqueUserName', 'IP' : '2.2.2.2' (optional) }
Example Response
{ 'ApiKey' : '1q3sdv97vfv', 'UserName': 'test1@example.com', 'EmailId': 'test1@example.com', 'CountryCode': 91, 'MobileNumber': '8123465790', 'R2faStatus': 'Enabled' / 'Bypass' / 'Denied', 'Tokens' : [ {...}, {...}, { 'TokenId' : 'dsvsdvs', 'TokenName' : 'Ascav', 'TokenType' : 'Hardware', 'TokenBlocked' : 0/1 } ], 'AuthMethods' : 0/1/2 }
4.4.Validation User OTP Request
POST /rest/v1/validate/user/otp
{ 'ApiKey' : '1q3sdv97vfv', 'LoginName' : 'root', 'UserName' : 'test1@example.com', 'EndUserIP' : '2.2.2.2', 'OTP' : '123456', 'AuthType' : 'H/S/B' }
Example Response
{ 'data': { 'ApiKey' : '1q3sdv97vfv', 'AuthResult' : 'OTP VALID/OTP INVALID' }, 'status': { 'code': 200, 'description': 'Success', 'error': true } }
4.5.Validation User Push Request
POST /rest/v1/validate/user/push
{ 'ApiKey' : '1q3sdv97vfv', 'LoginName' : 'root', 'UserName' : 'test1@example.com', 'EndUserIP' : '2.2.2.2', 'TokenId' : 'sdvsdvsv' }
Example Response
{ 'ApiKey' : '1q3sdv97vfv', 'PushTxnId': 'xxxxxxxx' }
4.6.Validation User Push Status Request
POST /rest/v1/validate/user/push/status
{ 'ApiKey' : 'zdvsdv97vfv', 'PushTxnId' : 'sdvsdv' }
Example Response
{ 'ApiKey' : 'zdvsdv97vfv', 'PushTxnId' : 'sdvsdv', 'PushState': 'xxxxxxxx' }
4.7.Win/Unix User Register Request
POST /rest/v1/validate/register/user
{ 'ApiKey' : '1q3sdv97vfv' 'LoginName' : 'root', 'DeviceUID' : 'DeviceUID', 'R2faStatus' : true/false }
Example Response
{ 'data': { }, 'status': { 'code' : 200, 'description' : 'Success', 'error' : true } }
4.8.Create User
POST /rest/v1/users
Example Response
{ 'EmailId': 'test1@example.com', 'ContactNumber': '8123465790', 'CountryCode': '91', 'UserName': 'test1@example.com', 'FirstName' : 'John', 'LastName' : 'Doe' } optional params : ['EmailId' , 'UserName', 'FirstName', 'LastName']
4.9.Edit User
PUT /rest/v1/users
Example Response
{ 'UserId': '4xc5Ha1OfWaeCaaP32JgVIuEv4vfMDTr', 'Email' : 'test1@example.com' 'FirstName' : 'John', 'LastName' : 'Doe', 'UserName': 'test1@example.com', 'CountryCode' : 91, 'ContactNumber' : 8123456789 }
except userId all are optional but atleast one should be present other than userId and also country code and ContactNumber should co-exist
4.10.Delete User
DELETE /rest/v1/users/{userId}
5.Get All Services
GET /rest/v1/services
Example Response
[ { 'ServiceName': 'Windows Demo', 'ServiceType': 'Windows PC', 'ActivationStatus': 'Inactive', 'ServiceId': 'badO2a9HFMMRcO3V' }, { 'ServiceName': 'Unix Test', 'ServiceType': 'UNIX_SSH', 'ActivationStatus': 'Active', 'ServiceId': 'cBFkTrt54gh72uXa' } ]
5.1.Get Services in Range
GET /rest/v1/services/{startIndex}/{endIndex}
Example Response
{ 'count': 9, 'details': [ { 'ServiceName': 'Windows Demo', 'ServiceType': 'Windows PC', 'ActivationStatus': 'Inactive', 'ServiceId': 'badO2a9HFMMRcO3V' }, { 'ServiceName': 'Unix Test', 'ServiceType': 'UNIX_SSH', 'ActivationStatus': 'Active', 'ServiceId': 'cBFkTrt54gh72uXa' } ] }
5.2.Get Details of Specific Service
GET /rest/v1/services/{serviceId}
Example Response
{ 'LastOnlineTime': 1511515440000, 'ServiceName': 'Windows Demo', 'ActivationTime': 1506427017970, 'ServiceType': 'Windows PC', 'ServiceVersion': '2.0.0', 'DeactivationTime': 1546214400000, 'ActivationStatus': 'Inactive', 'ServiceId': 'badO2a9HFMMRcO3V' }
5.3.Create Service
POST /rest/v1/services
Example Response
{ 'name': 'test_service', 'type': 'WEB_API' }
5.4.Edit Service
PUT /rest/v1/services
Example Response
{ 'ServiceId': 'cZ112rt54gh72uXa', 'ServiceName' : 'test1_service' }
except for ServiceId, all are optional but at least one should be present other than ServiceId
5.5.Map User To Service
POST /rest/v1/services/map
Example Response
{ 'ServiceId': '23uyaXJH211KGDmz', 'UserId': [ 'va1amntOzKq7oGhcJEdKYHUmloLIMwAy' ] }
5.6.Unmap User To Service
POST /rest/v1/services/unmap
Example Response
{ 'ServiceId': 'IIuyaXJH211KGDmz', 'UserId': 'vBvamntOzKq7oGhcJEdKYHUmloLIMwAy' }
5.7.Delete Service
DELETE /rest/v1/services/{serviceId}
6.Get All Tokens
GET /rest/v1/tokens
Example Response
[ { 'TokenType': 'Software', 'UserId': 'ZRH881ITh9PA6v7yScvmwu3cTlMEaWFa', 'AssignedUser': 'test1@example.com', 'TokenName': 'Xiaomi Redmi Note 4', 'TokenId': 'HN1QxREtyWRu2afqlbf69ZyZ3f6tV9Kg' }, { 'TokenType': 'Hardware', 'UserId': null, 'AssignedUser': 'Unassigned', 'TokenName': 'John', 'TokenId': 'hucyaN89IdlsDVJiaiAshfM8rQTKEjZt' } ]
6.1.Get Tokens in Range
GET /rest/v1/tokens/{startIndex}/{endIndex}
Example Response
{ 'count': 27, 'details': [ { 'TokenType': 'Software', 'UserId': 'ZRH881ITh9PA6v7yScvmwu3cTlMEaWFa', 'AssignedUser': 'test1@example.com', 'TokenName': 'Xiaomi Redmi Note 4', 'TokenId': 'HN1QxREtyWRu2afqlbf69ZyZ3f6tV9Kg' }, { 'TokenType': 'Hardware', 'UserId': null, 'AssignedUser': 'Unassigned', 'TokenName': 'John', 'TokenId': 'hucyaN89IdlsDVJiaiAshfM8rQTKEjZt' } ] }
6.2.Get Details of Specific Tokens
GET /rest/v1/tokens/{tokenId}
Example Response
{ 'details': { 'ModelName': 'Xiaomi Redmi Note 4', 'Platform': 'Android', 'IsRooted': 'yes', 'DeviceName': 'Xiaomi Redmi Note 4' }, 'info': { 'TokenType': 'Software', 'ActivationTime': 1512109623086, 'UserId': 'ZRH881ITh9PA6v7yScvmwu3cTlMEaWFa', 'TokenName': 'Xiaomi Redmi Note 4', 'TokenBlocked': 'no', 'DeactivationTime': 1546214400000, 'TokenId': 'HN1QxREtyWRu2afqlbf69ZyZ3f6tV9Kg', 'ActivationStatus': 'Active' } }
6.3.Create Token
POST /rest/v1/tokens
Example Response
{ 'TokenName': 'test_token', 'SerialNumber': '1656565465', 'HardwareType' : 'Seamon-3000' }
6.4.Map Token to User
POST /rest/v1/tokens/assign
Example Response
{ 'UserId': 'vBvamntOzKq7oGhcJEdKYHUmloLIMwAy', 'TokenId': 'hucyaN89IdlsDVJiaiAshfM8rQTKEjZt' }
6.5.Unmap Token To User
POST /rest/v1/tokens/unassign
Example Response
{ 'UserId': 'vBvamntOzKq7oGhcJEdKYHUmloLIMwAy', 'TokenId': 'hucyaN89IdlsDVJiaiAshfM8rQTKEjZt' }
6.6.Edit Token
PUT /rest/v1/tokens
Example Response
{ 'TokenId': '6a8vQSnqXY99ULkK6cXOXzaAKpmq8rJB', 'TokenName' : 'test1_token', 'TokenBlocked' : 'yes' }
except TokenId all are optional but atleast one should be present other than TokenId
6.7.Delete Token
DELETE /rest/v1/tokens/{tokenId}
7.Get All Bypass Codes For Specific User
GET /rest/v1/bypassCodes/{id}
Example Response
{ 'codes': [ { 'BypassCode': '57397661', 'ExpireTime': 1531743146368 }, { 'BypassCode': '96917674', 'ExpireTime': 1531743146368 } ], 'bypassCodeStatus': 'Enabled' }
7.1.Create Bypass Code
POST /rest/v1/bypassCodes
Example Response
{ 'userId': 'vBvamntOzKq7oGhcJEdKYHUmloLIMwAy', 'number': 1 }
7.2.Delete All Bypass Codes For Specific User
DELETE /rest/v1/bypassCodes/{userId}