How to access AppzillonServer from External service

Post Reply
User avatar
ilaiya.raja
Posts: 2
Joined: Mon Jul 16, 2018 12:13 pm
Company Name: iexceed

#1 How to access AppzillonServer from External service

Post by ilaiya.raja » Mon Aug 13, 2018 11:41 am

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

ripu.pandey
Posts: 3
Joined: Thu Jul 12, 2018 10:34 am
Company Name: i-exceed technology

#2 Re: How to access AppzillonServer from External service

Post by ripu.pandey » 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.

kkeyanb
Posts: 3
Joined: Tue Feb 05, 2019 1:11 pm
Company Name: CSS Corp

#3 Re: How to access AppzillonServer from External service

Post by kkeyanb » Fri Apr 12, 2019 7:19 pm

Hi,

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

Regards
Karthik

arthanarisamy
Posts: 12
Joined: Tue Jul 03, 2018 4:07 pm
Company Name: i-exceed

#4 Re: How to access AppzillonServer from External service

Post by arthanarisamy » Sat Apr 13, 2019 6:50 pm

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.

sreenadh
Posts: 2
Joined: Fri Apr 12, 2019 7:08 pm
Company Name: CSS Corp

#5 Re: How to access AppzillonServer from External service

Post by sreenadh » Mon Apr 15, 2019 5:42 pm

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

arthanarisamy
Posts: 12
Joined: Tue Jul 03, 2018 4:07 pm
Company Name: i-exceed

#6 Re: How to access AppzillonServer from External service

Post by arthanarisamy » Tue Apr 16, 2019 10:56 am

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.

sreenadh
Posts: 2
Joined: Fri Apr 12, 2019 7:08 pm
Company Name: CSS Corp

#7 Re: How to access AppzillonServer from External service

Post by sreenadh » Tue Apr 16, 2019 11:16 am

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

arthanarisamy
Posts: 12
Joined: Tue Jul 03, 2018 4:07 pm
Company Name: i-exceed

#8 Re: How to access AppzillonServer from External service

Post by arthanarisamy » Tue Apr 16, 2019 3:32 pm

Hi Sreenadh,

Kindly share the application server logs for the same.

Post Reply