Click or drag to resize

ServiceRouterGetUserIPAccess Method

Returns a GetUserIPAccessOut response with a result model List<GetUserIPAccessModel>

Namespace: AppOne.Services.V2
Assembly: AppOne.Web.Service (in AppOne.Web.Service.dll) Version: 1.0.141
Syntax
public GetUserIPAccessOut GetUserIPAccess(
	GetUserIPAccessIn input
)

Parameters

input  GetUserIPAccessIn
A new GetUserIPAccessIn object

Return Value

GetUserIPAccessOut
A GetUserIPAccessOut object
Remarks
Use this method to get a results list of GetUserIPAccessModel. The GetUserIPAccessModel contains the meta data necessary to report on a users IP access policy and will validate if the input IP list is a valid IP match.

Note  Note
Setup:
Manager > Employees > Policies
Configuration > Security > IP Access

Business Rules:
An IP Access Policy can be used to restrict users from accessing the system from non-approved networks. It can also be used to allow employees to access the system from home, but restrict their punching to approved networks. A user can only be assigned to IP access policy at a time.
Note  Note
If the inbound EmpIdentifier is not found then the IP Access Policy ID will be zero.
Example
JSON Request
{
    "AuthToken":"...",
    "UserIPAccessList":[
    {
        "EmpIdentifier":"1234",
        "IPMatchList":["212.56.3.1", "212.56.3.2"]
    },
    {
        "EmpIdentifier":"5555",
        "IPMatchList":[]
    },
    {
        "EmpIdentifier":"19",
        "IPMatchList":[]
    }
    ]
}
JSON Response
{
    "Report": {
        "APIVersion": "2.0",
        "ProcessTime": "0.1124317",
        "RequestTime": "/Date(1455665491372-0700)/",
        "ResponseTime": "/Date(1455665491484-0700)/",
        "Results": 1
    },
    "Results": [
        {
            "EmpIdentifier": "1234",
            "AllowPunch": false,
            "AllowSiteAccess": true,
            "ID": 1,
            "IPDetailMatch": true,
            "Name": "Main Office",
            "Details": [
                {
                    "Description": "Building 1",
                    "IPAddress": "212.56.3.*"
                },
                {
                    "Description": "Building 2",
                    "IPAddress": "212.56.4.*"
                }
            ]
        },
        {
            "EmpIdentifier": "555",
            "AllowPunch": false,
            "AllowSiteAccess": true,
            "ID": 1,
            "IPDetailMatch": false,
            "Name": "Remote Office",
            "Details": [
                {
                    "Description": "Building 1",
                    "IPAddress": "212.56.4.*"
                }
            ]
        },
        //Employee 19 not found
        {
          "EmpIdentifier": "19",
          "AllowPunch": false,
          "AllowSiteAccess": false,
          "ID": 0,
          "IPDetailMatch": false,
          "Name": "",
          "Details": [],

       }
    ]
}
SOAP: C# WCF Sample
try
{
    var actionTestLogic = new Action<SoapServiceV2.ServiceRouterClient>((client) =>
    {
        int countTest_1 = 0;
        SoapServiceV2.GetUserIPAccessRequest request = new SoapServiceV2.GetUserIPAccessRequest();
        List<UserIPAccessList> userIpAccessList = new List<UserIPAccessList>();
        UserIPAccessList userIpAccessListItem = new UserIPAccessList();
        userIpAccessListItem.EmpIdentifier = "123";
        userIpAccessList.Add(userIpAccessListItem);
        request.input = new SoapServiceV2.GetUserIPAccessIn
        {
            AuthToken = AuthToken,
            UserIPAccessList=userIpAccessList
        };
        SoapServiceV2.GetUserIPAccessResponse response = client.GetUserIPAccess(request);
        countTest_1 = (response.GetUserIPAccessResult.Results != null) ? response.GetUserIPAccessResult.Results.Count : 0;
        Assert.IsTrue(countTest_1 > 0);
    });

    RunServiceClient(actionTestLogic);
}
catch (FaultException<SoapServiceV2.ServiceException> fe)
{
    Assert.Fail(fe.Detail.Message);
}
See Also