Uncategorized

Public API – AuthX IAM Integration

  1. Public API’s for User Management (Create, Update, Deactivate & Activate users)

  2. AuthX Admin Portal Applications

    1. Created new application for Care / SAML / Certify Me

Pre-requisites

  1. To have a company in AuthX Admin portal

  2. Subscription – Either Trial or Enterprise Plan

  3. Applications – Create Manage API application


Each API request requires access token & hash value

API to get access token (Used for Authentication)

Request URL: https://api-wc016eh2.authx.com/PublicApiAccessToken

Request Headers

Property Name

Required

Type

Description

ApplicationId

yes

String

Manage API ApplicationId

ApplicationKey

yes

String

Manage API ApplicationKey

Application ID: 69c7d515-5b5a-f9a3-c560-6cc55026a989
Application Key: d8266783-46f8-6ce8-fae7-40fc60714d01

Response

Property Name

Type

Description

access_token

String

Token value

token_type

String

Value returned will be “bearer”

expires_in

String

Validity period (seconds)

.issued

String

Issued Date time

.expires

String

Expiring Datetime

Sample Response

{
    "access_token": "QcunPDRtdUCIZgYWuKH0ARksT-x-ZlbXkagNel1XgcjxLX18qK5fLhJc004xxly3wbhQCH9gbyQyrJgjRIWP_38NFvUVTSbINYfMEy8CRuDVD18h1Ub2Lq3FehahiPVSaYiJ3R6s4TVNOwz8Myanh4ZbwmRQv2UkyUsBDDmRrGQhHLe_C4hSl5Sbk9Q0H9b68nKMOcyUye-aHdK1sTwADQvZilOefvLQ9_oJl4jWixClMehhnWC2wFbBAMq-2WTLJr3mYW15mnwYdZ_MmI8bm-9FjqIGF2dfb-4KXgLZAsojeXNt1zZiP0Ou4L55zol3kTd1nkUWb_TSXK5Onrx1vbhSOP2oDj5Zv_EMPWnx1NmQPDPNZEgzkla6S-XqNy63Sz8q7JWAsQesdv5Y7tnDwA",
    "token_type": "bearer",
    "expires_in": 1209599,
    ".issued": "Tue, 16 Aug 2022 06:32:25 GMT",
    ".expires": "Tue, 30 Aug 2022 06:32:25 GMT"
}

Hash Value

  1. To get the HMAC key from AuthX Admin Portal → Settings-> Security Management

  2. Follow the below code sample value for generating HMAC key

    public static string GenerateHMACSHA256(string pretext, string key)
            {
    
    
    
               System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
                byte[] keyByte = encoding.GetBytes(key);
                HMACSHA256 hmacsha256 = new HMACSHA256(keyByte);
                HMACMD5 hmacmd5 = new HMACMD5(keyByte);
                byte[] messageBytes = encoding.GetBytes(pretext);
                byte[] hashmessage = hmacmd5.ComputeHash(messageBytes);
                hashmessage = hmacsha256.ComputeHash(messageBytes);
    
    
    
               return ByteToString(hashmessage);
            }

  3. Value Reference

Property Name

Type

Description

pretext

String

Combination of HmacKey + ‘:’ + RequestDatetime (Format – YYYYMMDDHHMMSS)

key

String

HMAC key for your company (451B8DE7-F81C-41B0-B522-694B001CDFF6)


Add User

Request URL: https://api-wc016eh2.authx.com/AddUser

Request Headers

Property Name

Required

Type

Description

authenticatehash

yes

String

Value returned from Hash Value → Step 2

Authorization

yes

string

bearer token

'authenticatehash : F3F5AE47737F1FB362D97C234CC6B709DD7A59B8C0B22379CCEB9D398BB47C4E'
'Authorization: Bearer FS6gKnDhAyoOsD9L8x5ggJ5wfnPTjbsA0rfSvL4-QETlM8lrKTozbi8oPJ04moIIdkFM0U6_iTbJCSouWdT1-8ZCPdpa9p2HDMyJwz3YSMEQejmSppB_npQeaIpCttHG7PwqIS_fPYBDCyv-zAs9m3FwXeo1vcBpGrsTerI-oJTXUz-7YyQx67mYaSgzUOLkZDw9Vk7YeJjN2FDz23gHcHF5RjGFBcedneEA7RMZJAS0FKQ' 

Request Body

Key

Required

Type

Description

user_name

Yes

String

Unique username of user

first_Name

Yes

String

First Name

last_Name

Yes

String

Last Name

email

Yes

String

Email

countrycode

Yes

string

Country code

number

Yes

String

Phone number

alias_name

No

String

Additional usernames for the user

alias_name1

No

String

Additional usernames for the user

alias_name2

No

String

Additional usernames for the user

alias_name3

No

String

Additional usernames for the user

alias_name4

No

String

Additional usernames for the user

RequestDateTime

Yes

String

Set date & time (Format – YYYYMMDDHHMMSS)

Sample Request

  • Add User Request

{

    "UserName": "gsinghyopmail13",
    "Email": "gurlal8480000@yopmail.com",
    "Name": {
        "FirstName": "gurlal",
        "LastName": "singh"
    },
    "Mobile": {
        "CountryCode": "+91", //deafult if not passed would be +1
        "Number": "9646980238"
    },
    "AlaisName": "", //Optional,
    "AlaisName1": "", //Optional,
    "AlaisName2": "", //Optional,
    "AlaisName3": "", //Optional,
    "AlaisName4": "", //Optional,
    "RequestDateTime": "20220607092858"

}

Response Body

Key

Type

Description

response_code

Integer

1 – Success ,0 – Error

response_subcode

Integer

100 – Exception

response_text

String

Message description if error occurs

response_data

string

UniqueuserId of the user added

Sample Response

  • Add User response

{

    "response_code": 1,
    "response_subcode": 0,
    "response_text": null,
    "response_data": "{\"UniqueUserId\":\"1ca73990-a948-4ef7-ad76-5e8d0356dbc4\",\"TimeStamp\":\"2022-08-16T06:56:06.6776292Z\"}",
    "accessToken": null,
    "refreshToken": null

}

Update User

Request URL: https://api-wc016eh2.authx.com/UpdateUser

Request Headers

Property Name

Required

Type

Description

authenticatehash

yes

String

Value returned from Hash Value → Step 2

Authorization

yes

string

bearer token

'authenticatehash : F3F5AE47737F1FB362D97C234CC6B709DD7A59B8C0B22379CCEB9D398BB47C4E'
'Authorization: Bearer FS6gKnDhAyoOsD9L8x5ggJ5wfnPTjbsA0rfSvL4-QETlM8lrKTozbi8oPJ04moIIdkFM0U6_iTbJCSouWdT1-8ZCPdpa9p2HDMyJwz3YSMEQejmSppB_npQeaIpCttHG7PwqIS_fPYBDCyv-zAs9m3FwXeo1vcBpGrsTerI-oJTXUz-7YyQx67mYaSgzUOLkZDw9Vk7YeJjN2FDz23gHcHF5RjGFBcedneEA7RMZJAS0FKQ' 

Request Body

Key

Required

Type

Description

UniqueUserId

Yes

String

Unique GUID of the user

user_name

Yes

String

Unique username of user

first_Name

Yes

String

First Name

last_Name

Yes

String

Last Name

email

Yes

String

Email

countrycode

Yes

string

Country code

number

Yes

String

Phone number

alias_name

No

String

Additional usernames for the user

alias_name1

No

String

Additional usernames for the user

alias_name2

No

String

Additional usernames for the user

alias_name3

No

String

Additional usernames for the user

alias_name4

No

String

Additional usernames for the user

RequestDateTime

Yes

String

Set date & time (Format – YYYYMMDDHHMMSS)

Sample Request

  • Update User Request

{

    "UniqueUserId": "1ca73990-a948-4ef7-ad76-5e8d0356dbc4",
    "UserName": "gurlal001",
    "Email": "gayle50@humanxample.com",
    "Name": {
        "FirstName": "sandeep",
        "LastName": "singh"
    },
    "Mobile": {
        "CountryCode": "+91", //deafult if not passed would be +1
        "Number": "9646980238"
    },
    "AlaisName": "", //Optional,
    "AlaisName1": "", //Optional,
    "AlaisName2": "", //Optional,
    "AlaisName3": "", //Optional,
    "AlaisName4": "" ,//Optional,
    "RequestDateTime": "20220607092858"

}

Response Body

Key

Type

Description

response_code

Integer

1 – Success ,0 – Error

response_subcode

Integer

100 – Exception

response_text

String

Message description if error occurs

response_data

string

UniqueuserId of the user added

Sample Response

  • Update User response

{

    "response_code": 1,
    "response_subcode": 0,
    "response_text": null,
    "response_data": "{\"UniqueUserId\":\"1ca73990-a948-4ef7-ad76-5e8d0356dbc4\",\"TimeStamp\":\"2022-08-16T07:07:11.9578273Z\"}",
    "accessToken": null,
    "refreshToken": null

}

Deactivate User

Request URL: https://api-wc016eh2.authx.com/DeactivateUser

Request Headers

Property Name

Required

Type

Description

authenticatehash

yes

String

Value returned from Hash Value → Step 2

Authorization

yes

string

bearer token

'authenticatehash : F3F5AE47737F1FB362D97C234CC6B709DD7A59B8C0B22379CCEB9D398BB47C4E'
'Authorization: Bearer FS6gKnDhAyoOsD9L8x5ggJ5wfnPTjbsA0rfSvL4-QETlM8lrKTozbi8oPJ04moIIdkFM0U6_iTbJCSouWdT1-8ZCPdpa9p2HDMyJwz3YSMEQejmSppB_npQeaIpCttHG7PwqIS_fPYBDCyv-zAs9m3FwXeo1vcBpGrsTerI-oJTXUz-7YyQx67mYaSgzUOLkZDw9Vk7YeJjN2FDz23gHcHF5RjGFBcedneEA7RMZJAS0FKQ' 

Request Body

Key

Required

Type

Description

UniqueUserId

Yes

String

Unique GUID of the user

RequestDateTime

Yes

String

Set date & time (Format – YYYYMMDDHHMMSS)

Sample Request

  • Deactivate User Request

{

    "UniqueUserId": "1ca73990-a948-4ef7-ad76-5e8d0356dbc4",
    "RequestDateTime": "20220607092858"

}

Response Body

Key

Type

Description

response_code

Integer

1 – Success ,0 – Error

response_subcode

Integer

100 – Exception

response_text

String

Message description if error occurs

response_data

string

UniqueuserId of the user added

Sample Response

  • Deactivate User response

{

    "response_code": 1,
    "response_subcode": 0,
    "response_text": null,
    "response_data": null,
    "accessToken": null,
    "refreshToken": null

}

Activate User

Request URL: https://api-wc016eh2.authx.com/ActivateUser

Request Headers

Property Name

Required

Type

Description

authenticatehash

yes

String

Value returned from Hash Value → Step 2

Authorization

yes

string

bearer token

'authenticatehash : F3F5AE47737F1FB362D97C234CC6B709DD7A59B8C0B22379CCEB9D398BB47C4E'
'Authorization: Bearer FS6gKnDhAyoOsD9L8x5ggJ5wfnPTjbsA0rfSvL4-QETlM8lrKTozbi8oPJ04moIIdkFM0U6_iTbJCSouWdT1-8ZCPdpa9p2HDMyJwz3YSMEQejmSppB_npQeaIpCttHG7PwqIS_fPYBDCyv-zAs9m3FwXeo1vcBpGrsTerI-oJTXUz-7YyQx67mYaSgzUOLkZDw9Vk7YeJjN2FDz23gHcHF5RjGFBcedneEA7RMZJAS0FKQ' 

Request Body

Key

Required

Type

Description

UniqueUserId

Yes

String

Unique GUID of the user

RequestDateTime

Yes

String

Set date & time (Format – YYYYMMDDHHMMSS)

Sample Request

  • Activate User Request

{

    "UniqueUserId": "1ca73990-a948-4ef7-ad76-5e8d0356dbc4",
    "RequestDateTime": "20220607092858"

}

Response Body

Key

Type

Description

response_code

Integer

1 – Success ,0 – Error

response_subcode

Integer

100 – Exception

response_text

String

Message description if error occurs

response_data

string

UniqueuserId of the user added

Sample Response

  • Activate User response

{

    "response_code": 1,
    "response_subcode": 0,
    "response_text": null,
    "response_data": null,
    "accessToken": null,
    "refreshToken": null

}

Error Codes

Key

Type

Description

response_code

Integer

1 – Success ,

0 – Error,

FaceNotMatch – 2,
FaceQualityPoor – 3,
TooManyFace – 4,
FaceNotFound – 5,
FaceOutBound – 6,
SettingsMissed – 7,
UserNotExists – 8

response_subcode

Integer

100 – Exception

119 – User not exists

417 – API Management is not allowed with current subscription

response_text

String

Message description if error occurs

Leave a Reply