UserService 1401 UnAuthorized Access Error

0 votes

	

	
	App42.initialize(constval.API, constval.KEY);
	var userCode = App42.getLoggedInUser();
	var userService = new App42User();
	userService.getUser(userCode, {
		success : function(object) {
			try {
				var userObj = JSON.parse(object);
				result = userObj.app42.response.users.user;
				$('#profiloEmail').text(result.email);
				$("#profilePageLoader").hide();
			} catch (error) {
				console.log(error.message);
			}
		},
		error : function(error) {
			$("#profilePageLoader").hide();
			showPageLoadingError("Utente NON trovato.", 5000);
		}
	});

 

 

Hello,

When I execute this code for the first time I get an Un Authorized Access Error

If I do it for the second time it work correctly. I need to read the email associated to a user.

 
asked Feb 27, 2017 in JavaScript by odf (37 points)
edited Feb 27, 2017 by odf

1 Answer

0 votes
Hi,

Team has tried to reproduce but they were unable to reproduce. It is working fine at our end.

Could you please share any sample in which we can reproduce this at our end. It will help us to understand the problem you are facing.

Thanks.
answered Mar 1, 2017 by rajeev.etc (1,660 points)
Hello,
what you need exactly ?
When I call the getUser function I get often (not always) the   1401 Exception.
I use it in a Phonegap app, using the most recent Javascript SDK.

What you need the code is very simple. I can use debug loggin with javascript SDK ?
Best regards
Hi Odf,

Please provide DOM info(which you can copy from network section of browser) related to the get user API? First When you get an exception and second when you get success response?

Please share the complete information on support@shephertz.com. It will help us to provide better support to you.

Regards,
Himanshu Sharma
Hello,
Was this issue ever solved, as I am having a similar problem with occasional 401 exception Unautorized

Regards,
Connal.
Hi Connal,

Please provide DOM info(which you can copy from network section of browser) related to the get user API? First When you get an exception and second when you get success response?

Please share the complete information on support@shephertz.com. It will help us to provide better support to you.

Regards,
Himanshu Sharma
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...