Documentation

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'
}
Yes No

2.Org Info #

GET /rest/v1/organization

Request : GET /rest/v1/organization
Response : 
{
    'ActivationTime': 1498213552544,
    'OrgWebsite': 'www.example.com',
    'OrgName': 'Demo_Technologies',
    'DeactivationTime': 1546214400000,
    'ActivationStatus': 'Active'
}
Yes No

3.Billing #

GET /rest/v1/billing

Request : GET /rest/v1/billing
Response : 
{
    'PlanType': 'Demo',
    'AllowedUserCount': 150,
    'AllowedServiceCount': 150,
    'CurrentServiceCount': 10,
    'CurrentUserCount': 15
}
Yes No

4.Get All Users #

GET /rest/v1/users

Request : GET /rest/v1/users
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
    }
]
Yes No

4.1.Get Users In Range #

GET /rest/v1/users/{startIndex}/{endIndex}

Request : GET /rest/v1/users/{startIndex}/{endIndex}
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
    }
    ]
}
Yes No

4.2.Get Details of Specific User #

GET /rest/v1/users/{userId}

Request : GET /rest/v1/users/{userId}
Response : 
{
	'EmailId': 'test1@example.com',
	'MobileNumber': '8123465790',
	'UserName': 'test1@example.com',
	'hardTokenCount': 1,
	'FirstName': 'John',
	'UserR2faStatus': 'Enabled',
	'LastName': 'Doe',
	'CountryCode': 91,
	'softTokenCount': 3
}
Yes No

4.3.Validation User Info Request #

POST /rest/v1/validate/user

Request : POST /rest/v1/validate/user
{
	'ApiKey' : 'zdvsdv97vfv'
	'LoginName' : 'root',
	'UserName' : 'test1@example.com/uniqueUserName',
	'IP' : '2.2.2.2' (optional)
}

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
}
Yes No

4.4.Validation User OTP Request #

POST /rest/v1/validate/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'
}

Response:
{
	'data': {
		'ApiKey' : '1q3sdv97vfv',
		'AuthResult' : 'OTP VALID/OTP INVALID'
	},
        'status': {
                'code': 200,
                'description': 'Success',
                'error': true
    }
}
Yes No

4.5.Validation User Push Request #

POST /rest/v1/validate/user/push

Request : POST /rest/v1/validate/user/push
{
	'ApiKey' : '1q3sdv97vfv',
	'LoginName' : 'root',
	'UserName' : 'test1@example.com',
	'EndUserIP' : '2.2.2.2',
	'TokenId' : 'sdvsdvsv'
}

Response :
{
	'ApiKey' : '1q3sdv97vfv',
	'PushTxnId': 'xxxxxxxx'
}
Yes No

4.6.Validation User Push Status Request #

POST /rest/v1/validate/user/push/status

Request : POST /rest/v1/validate/user/push/status
{
	'ApiKey' : 'zdvsdv97vfv',
	'PushTxnId' : 'sdvsdv'
}

Response :
{
	'ApiKey' : 'zdvsdv97vfv',
	'PushTxnId' : 'sdvsdv',
	'PushState': 'xxxxxxxx'
}
Yes No

4.7.Win/Unix User Register Request #

POST /rest/v1/validate/register/user

Request : POST /rest/v1/validate/register/user
{
	'ApiKey' : '1q3sdv97vfv'
	'LoginName' : 'root',
	'DeviceUID' : 'DeviceUID',
	'R2faStatus' : true/false
}

Response :

{
	'data': {		
	},
        'status': {
            'code' : 200,
            'description' : 'Success',
            'error' : true
        }
}
Yes No

4.8.Create User #

POST /rest/v1/users

Request : POST /rest/v1/users
{
	'EmailId': 'test1@example.com',
	'ContactNumber': '8123465790',
	'CountryCode': '91',
	'UserName': 'test1@example.com',
	'FirstName' : 'John',
	'LastName' : 'Doe'
}
optional params : ['EmailId' , 'UserName', 'FirstName', 'LastName']
Yes No

4.9.Edit User #

PUT /rest/v1/users

Request : PUT /rest/v1/users
{
	'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

Yes No

4.10.Delete User #

DELETE /rest/v1/users/{userId}

Request : DELETE /rest/v1/users/{userId}
Yes No

5.Get All Services #

GET /rest/v1/services

Request : GET /rest/v1/services
Response : 
[
        {
		'ServiceName': 'Windows Demo',
		'ServiceType': 'Windows PC',
		'ActivationStatus': 'Inactive',
		'ServiceId': 'badO2a9HFMMRcO3V'
	},
	{
		'ServiceName': 'Unix Test',
		'ServiceType': 'UNIX_SSH',
		'ActivationStatus': 'Active',
		'ServiceId': 'cBFkTrt54gh72uXa'
	}
]
Yes No

5.1.Get Services in Range #

GET /rest/v1/services/{startIndex}/{endIndex}

Request : GET /rest/v1/services/{startIndex}/{endIndex}
Response :
{
    'count': 9,
    'details': [
        {
            'ServiceName': 'Windows Demo',
            'ServiceType': 'Windows PC',
            'ActivationStatus': 'Inactive',
            'ServiceId': 'badO2a9HFMMRcO3V'
        },
        {
            'ServiceName': 'Unix Test',
            'ServiceType': 'UNIX_SSH',
            'ActivationStatus': 'Active',
            'ServiceId': 'cBFkTrt54gh72uXa'
        }
    ]
}
Yes No

5.2.Get Details of Specific Service #

GET /rest/v1/services/{serviceId}

Request : GET /rest/v1/services/{serviceId}
Response : 
{
	'LastOnlineTime': 1511515440000,
	'ServiceName': 'Windows Demo',
	'ActivationTime': 1506427017970,
	'ServiceType': 'Windows PC',
	'ServiceVersion': '2.0.0',
	'DeactivationTime': 1546214400000,
	'ActivationStatus': 'Inactive',
	'ServiceId': 'badO2a9HFMMRcO3V'
}
Yes No

5.3.Create Service #

POST /rest/v1/services

Request : POST /rest/v1/services
{
     'name': 'test_service',
     'type': 'WEB_API'
}
Yes No

5.4.Edit Service #

PUT /rest/v1/services

Request : PUT /rest/v1/services
{
     'ServiceId': 'cZ112rt54gh72uXa',
     'ServiceName' : 'test1_service'
}

except ServiceId all are optional but atleast one should be present other than ServiceId

Yes No

5.5.Map User To Service #

POST /rest/v1/services/map

Request : POST /rest/v1/services/map
{
     'ServiceId': '23uyaXJH211KGDmz',
     'UserId': [
	    'va1amntOzKq7oGhcJEdKYHUmloLIMwAy'
     ]
}
Yes No

5.6.Unmap User To Service #

POST /rest/v1/services/unmap

Request : POST /rest/v1/services/unmap
{
     'ServiceId': 'IIuyaXJH211KGDmz',
     'UserId': 'vBvamntOzKq7oGhcJEdKYHUmloLIMwAy'
}
Yes No

5.7.Delete Service #

DELETE /rest/v1/services/{serviceId}

Request : DELETE /rest/v1/services/{serviceId}
Yes No

6.Get All Tokens #

GET /rest/v1/tokens

Request : GET /rest/v1/tokens
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'
	}
]
Yes No

6.1.Get Tokens in Range #

GET /rest/v1/tokens/{startIndex}/{endIndex}

Request : GET /rest/v1/tokens/{startIndex}/{endIndex}
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'
        }
    ]
}
Yes No

6.2.Get Details of Specific Tokens #

GET /rest/v1/tokens/{tokenId}

Request : GET /rest/v1/tokens/{tokenId}
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'
	}
}
Yes No

6.3.Create Token #

POST /rest/v1/tokens

Request : POST /rest/v1/tokens
{
     'TokenName': 'test_token',
     'SerialNumber': '1656565465',
     'HardwareType' : 'Seamon-3000'
}
Yes No

6.4.Map Token to User #

POST /rest/v1/tokens/assign

Request : POST /rest/v1/tokens/assign
{
     'UserId': 'vBvamntOzKq7oGhcJEdKYHUmloLIMwAy',
     'TokenId': 'hucyaN89IdlsDVJiaiAshfM8rQTKEjZt'
}
Yes No

6.5.Unmap Token To User #

POST /rest/v1/tokens/unassign

Request : POST /rest/v1/tokens/unassign
{
     'UserId': 'vBvamntOzKq7oGhcJEdKYHUmloLIMwAy',
     'TokenId': 'hucyaN89IdlsDVJiaiAshfM8rQTKEjZt'
}
Yes No

6.6.Edit Token #

PUT /rest/v1/tokens

Request : PUT /rest/v1/tokens
{
     'TokenId': '6a8vQSnqXY99ULkK6cXOXzaAKpmq8rJB',
     'TokenName' : 'test1_token',
     'TokenBlocked' : 'yes'
}

except TokenId all are optional but atleast one should be present other than TokenId

Yes No

6.7.Delete Token #

DELETE /rest/v1/tokens/{tokenId}

Request : DELETE /rest/v1/tokens/{tokenId}
Yes No

7.Get All Bypass Codes For Specific User #

GET /rest/v1/bypassCodes/{id}

Request : GET /rest/v1/bypassCodes/{id}
Response : 
{
	'codes': [
		{
			'BypassCode': '57397661',
			'ExpireTime': 1531743146368
		},
		{
			'BypassCode': '96917674',
			'ExpireTime': 1531743146368
		}
	],
	'bypassCodeStatus': 'Enabled'
}
Yes No

7.1.Create Bypass Code #

POST /rest/v1/bypassCodes

Request : POST /rest/v1/bypassCodes
{
     'userId': 'vBvamntOzKq7oGhcJEdKYHUmloLIMwAy',
     'number': 1
}
Yes No

7.2.Delete All Bypass Codes For Specific User #

DELETE /rest/v1/bypassCodes/{userId}

Request : DELETE /rest/v1/bypassCodes/{userId}
Yes No