Page 1 of 1

#1 How to access AppzillonServer from External service

Posted: Mon Aug 13, 2018 11:41 am
by ilaiya.raja
Hi Team,

Requirement -: To run scheduler from other server, which will hit appzillon server on particular interval time and it will update some data respective to the appzillon interfaces which we using.

Please explain the approach for above requirement for following builds.
1. 3.1.44
2. 3.5.3

#2 Re: How to access AppzillonServer from External service

Posted: Mon Aug 13, 2018 4:20 pm
by ripu.pandey
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.

#3 Re: How to access AppzillonServer from External service

Posted: Fri Apr 12, 2019 7:19 pm
by kkeyanb
Hi,

It is mentioned to Maintain user-level 5 .Where do we set this in Appzillon.What does this level mean.Thanks.

Regards
Karthik

#4 Re: How to access AppzillonServer from External service

Posted: Sat Apr 13, 2019 6:50 pm
by arthanarisamy
Hi Karthik,

You can set user level to 5 using Appzillon's Admin module under User Maintenance. User level 5 is enterprise user, whom will have additional privilege to not to expiry password.
In case password has to be changed, please reset user's password using Appzillon's admin module.

#5 Re: How to access AppzillonServer from External service

Posted: Mon Apr 15, 2019 5:42 pm
by sreenadh
ripu.pandey wrote:
Mon Aug 13, 2018 4:20 pm
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.
Hi I have tried to call AppzillonServer as mentioned above from postman to get servernonce but getting
Error 401--Unauthorized

#6 Re: How to access AppzillonServer from External service

Posted: Tue Apr 16, 2019 10:56 am
by arthanarisamy
Please check if you are passing authorisation header while invoking appzillonGetUserAppAccessToken request from Postman.

Unauthorised error is thrown only in case you pass adequate no authentication credentials or invalid credentials.

#7 Re: How to access AppzillonServer from External service

Posted: Tue Apr 16, 2019 11:16 am
by sreenadh
Hi arthanarisamy,

I am sending valid credentials through authorization header, with these credentials i can login to application through web without any issue, but i am getting unauthorized error when i tried from Postman.

Regards,
Sreenadh

#8 Re: How to access AppzillonServer from External service

Posted: Tue Apr 16, 2019 3:32 pm
by arthanarisamy
Hi Sreenadh,

Kindly share the application server logs for the same.