Employee Directory Integration

Employee Directory Integration

3/6/2019 9:12:15 AM

For directory integration we need a web service with the below methods:

Method1:

GetEmployee(string code, string domain)

-          [code] will be sent in a separate email,

[domain] example ("myorganization\") return type list of EmpForJson

-          URL example to be called from intranet side: https://MyOrganization.com/api/GetEmployee?code=XXXX-XXX-XXXX&domain=myorganization\

-          Verb: GET

-          returned Json example:               

[{"EMP_ID":"myorganization\\employeeid","EMP_EMAIL":"[email protected]","TitleName":"Senior Solution developer","EMP_NAME":"Employee Name","EMP_FIRST_NAME":"First","EMP_LAST_NAME":"Last",

"MANAGER_ID":"myorganization\\managerid","MANAGER_EMAIL":"[email protected]","DepartmentName":"Operations","SubDepartmentName":"Sub Department1","EMP_JOIN_DATE":"\/Date(1397028846000)\/","RELIGION_NAME":"Muslim","EMP_COMPANY":"Company Name","EMP_COUNTRY":"EG","EMP_HR_CODE":"1234","EMP_telephoneNumber":"1582","EMP_MOBILE_PHONE":null,"ImageBytes":null}]

         

Method2:

ValidatingUser([FromBody]MsgForJson msgForJson1)

- -          returns JsonResult "True" or "False"

-          URL example to be called from intranet side:  https://MyOrganization.com/api/ValidatingUser

  Status (should store the EMP_ID)

  Description (Should store the Password)


-          Verb: POST

 

Method3:


ChangePassword(HttpRequestMessage request)

 string json = request.Content.ReadAsStringAsync().Result;

-json is a List of “DictionaryObj”, that contains “code”, “LoginName”, “UserPass”, “NewPass”

-returns string "True" or "False"

-URL example to be called from intranet side: https://MyOrganization.com/api/ChangePassword

- Sent json example:

[{"Key":"code","Value":"xxxxx-xxxxx"},{"Key":"LoginName","Value":"myorganization\\jim"},{"Key":"UserPass","Value":"123456"},{"Key":"NewPass","Value":"123456789"}]

-Verb: POST



 

Method4:

UpdateEmployeeAD(HttpRequestMessage request)

 string json = request.Content.ReadAsStringAsync().Result;

-          “json” parameter should be mapped to “EmpForJson” object

-          returns MsgForJson

·         For success: MsgForJson.Status = "200"

·         For error: MsgForJson.Status = "500"

, MsgForJson.Description = “Detailed error description”

-          URL example to be called from intranet side: 

-          https://MyOrganization.com/api/UpdateEmployeeAD

-          Verb: POST

 

 

 

 

Notes:

-          All methods should allow only HTTPS access

-          Types structure as below:

 

 

public class MsgForJson

    {

        public string Status { get; set; }           //EMP_ID  

        public string Description { get; set; }//Password

        public string MoreDetails { get; set; }

    }

public class EmpForJson

    {

        public string EMP_ID { get; set; }

        public string EMP_EMAIL { get; set; }

        public string EMPLOYEE_OU { get; set; } //(Not mandatory)

        public string TitleName { get; set; }

        public string EMP_NAME{ get; set; }

        public string EMP_FIRST_NAME { get; set; }

        public string EMP_LAST_NAME { get; set; }

        public string MANAGER_ID { get; set; }

        public string MANAGER_EMAIL { get; set; }

        public string MANAGER_OU { get; set; } //(Not mandatory)

        public string DepartmentName { get; set; }

        public string SubDepartmentName { get; set; }

        public System.DateTime EMP_JOIN_DATE { get; set; }

        public string RELIGION_NAME { get; set; }    

        public string EMP_COMPANY { get; set; }

        public string EMP_COUNTRY { get; set; } //Only two letters, example 'EG'

        public string EMP_HR_CODE { get; set; }

        public string EMP_telephoneNumber { get; set; } //(Not mandatory)

        public string EMP_MOBILE_PHONE { get; set; }       //(Not mandatory)

        public byte[] ImageBytes { get; set; }//(Not mandatory)

    }

public class DictionaryObj

    {

        public string Key { get; set; }

        public object Value { get; set; }

    }

 

 

Keywords:
Employee-Directory-Integration