Follow the below steps for accessing AppzillonServer's services from Enterprise External Services.
Step -1 : Maintain user-level 5
Step -2 : Set token expiry time as part of application security parameters.
Step -3 : Send below request format to AppzillonServer URL to get serverNonce. While sending request to AppzillonServer please set Basic Auth in HttpHeader as
(a) Get encoded base64 value of userId and password.
(b) And send through httpheader “Authorization” by https protocol.
Ex:Username: test
Password: test123
HttpHeader: "Authorization":"Basic YWRtaW46YWRtaW4=".
Request :-
{ "appzillonHeader": {
"appId": "APPID",
"deviceId": "DEVICEID",
"userId": "test",
"status": "true",
"requestKey": "",
"clientNonce": 1,
"interfaceId": "appzillonGetUserAppAccessToken",
"screenId": "" },
"appzillonBody": { }
}
You will get below Response :-
{ "appzillonBody": {
"appzillonGetUserAppAccessTokenResponse": {
"sessionToken": "YWRtaW5+QXBwemlsbG9uQWRtaW4=",
"userAppAccessToken": "tHDDwhZw4ytg2tnDTZMvj6UhbGrfK71y",
"serverNonce": "pAdHg46JJcTd5bjxPjlyopt01529041448715"
}
}, "appzillonHeader": {
"screenId": "",
"requestKey": "",
"appId": "APPID",
"requestID": "",
"source": "",
"interfaceId": "appzillonGetUserAppAccessToken",
"status": "true",
"sessionId": "",
"userId": "test",
"longitude": "",
"latitude": "",
"deviceId": "DEVICEID"
}
}
Step :- 4 Now you got 'serverNonce', 'userAppAccessToken' and 'sessionToken' from AppzillonServer. Once you got serverNonce then you can send any request according to your requirement. For example I am sending below request to search a user from AppzillonServer. For sending next request you have to consider below points.
i) Copy "serverNonce" from above response and replace it in the next subsequent request inside "appzillonHeader".
ii) Generate Random number and assign it to "clientNonce" in the next subsequent request inside "appzillonHeader"..
iii) Copy "userAppAccessToken" from the above response and set it in next request HttpHeader as Bearer Token like:
HttpHeader: "Authorization":"Bearer lyxqdEfV6DlsnXo8af0EyN6MtJOPWDvV" authorization as Bearer Token
Request - (This is just a sample request format to follow. According to your requirement it can be changed)
{
"appzillonBody": {
"tbAsmiUser": {
"appId": "APPID",
"userId": "%",
"userName": "%"
}
},
"appzillonHeader": {
"os": "WEBCONTAINER",
"requestKey": "",
"appId": "APPID",
"clientNonce": 2,
"status": "success",
"interfaceId": "UserProfileQuery_Query",
"origination": "127.0.0.1",
"sessionToken": "YWRtaW5+QXBwemlsbG9uQWRtaW4=",
"sessionId": "",
"userId": "test",
"serverNonce": "pAdHg46JJcTd5bjxPjlyopt01529041448715",
"deviceId": "DEVICEID"
}
}
Response :-
{
"appzillonBody": {
"tbAsmiUser": [
{
"appId": "AppzillonAdmin",
"userId": "admin",
"userName": "admin",
"userActive": "Y"
}
],
"userDetail": [ ]
},
"appzillonHeader": {
"requestKey": "",
"appId": "APPID",
"clientNonce": "2",
"status": "success",
"interfaceId": "UserProfileQuery_Query",
"sessionToken": "YWRtaW5+QXBwemlsbG9uQWRtaW4=",
"sessionId": "",
"serverNonce": "pAdHg46JJcTd5bjxPjlyopt01529041448715",
"userId": "test",
"longitude": "",
"latitude": "",
"deviceId": "DEVICEID"
}
}
Note :- sessionToken and serverNonce should be used from the response of “appzillonGetUserAppAccessToken” request. And clientNonce should be an unique value for every request.