Public User Id endpoint error

109 views
Skip to first unread message

rob

unread,
May 7, 2014, 10:07:10 AM5/7/14
to vitadock-...@googlegroups.com
We had been using the user id endpoint detailed in:
https://github.com/Medisana/vitadock-api/wiki/Access-Public-User-Id-%5Bbeta%5D

It used to return a user_id in the following format
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx

Now I receive the html for a login page.
<html><head><title>Login Page</title></head><body onload='document.f.j_username.focus();'>
<h3>Login with Username and Password</h3><form name='f' action='/auth/j_spring_security_check' method='POST'>
<table>
<tr><td>User:</td><td><input type='text' name='j_username' value=''></td></tr>
<tr><td>Password:</td><td><input type='password' name='j_password'/></td></tr>
<tr><td colspan='2'><input name="submit" type="submit" value="Login"/></td></tr>
</table>
</form></body></html>

Visiting the url in a browser it seems the endpoint is now protected by a basic_auth prompt.
Is this deliberate? If so is there any other endpoint where the user-id can be retrieved from?

Regards,
Rob Hand
Tictrac

Clemens Lode

unread,
May 8, 2014, 5:45:32 AM5/8/14
to rob, vitadock-...@googlegroups.com
Hi Rob,

We moved it to another place, it shouldn't be on the auth server but on the data server (because it is data and has nothing to do with authentication). I will fix it in the documentation.

This is the new interface:
/data/publicusers/sync

If there is no public id for the user, a new (permanent) random one will be created.

Best regards,
Clemens




--
You received this message because you are subscribed to the Google Groups "VitaDock Online API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vitadock-online...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
clemen...@medisanaspace.com
Software Architect
www.medisana.de
www.vitadock.de

Medisana Space Technologies GmbH
Flinger Str. 11
40213 Düsseldorf

Amtsgericht Düsseldorf HRB 57800
UST-ID-Nr.: DE265101500
Geschäftsführer: Ralf Lindner, Ulrich Schulze Althoff

Rob Hand

unread,
May 8, 2014, 6:47:59 AM5/8/14
to Clemens Lode, vitadock-...@googlegroups.com
Hi Clemens,

Thanks for the prompt reply.

I receive the following 404 error on the new endpoint location:

Server Response: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Error report</title><style type="text/css"><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - </h1><hr/><p><b>type</b> Status report</p><p><b>message</b></p><p><b>description</b>The requested resource () is not available.</p><hr/></body></html>
Status Code: 404
GET https://cloud.vitadock.com/data/publicuser/sync?oauth_token=<snip>
Headers: {'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', 'Accept-Encoding': 'gzip, deflate, compress', 'Authorization': u'OAuth oauth_version="1.0",oauth_token="<snip>",oauth_nonce="494349543162604665660361162398331659",oauth_timestamp="1399545770",oauth_signature="<snip>"', 'User-Agent': 'python-requests/1.2.3 CPython/2.7.3 Linux/3.2.0-56-generic'}


Regards,
Rob
--
Rob Hand
Tictrac

Clemens Lode

unread,
May 8, 2014, 7:02:01 AM5/8/14
to Rob Hand, vitadock-...@googlegroups.com
Hi Rob,

It's a standard data interface just like all the other modules. You need
to use the standard parameter (remove the ?oauth_token, include the
Authorization header etc.)

Best regards,
Clemens
Software Architect Vitadock Online

clemen...@medisanaspace.com
www.medisana.de
www.vitadock.de
www.vitadock-online.com

Medisana Space Technologies GmbH
Flinger Str. 11
40213 Düsseldorf

skype clemens.lode
mobile +49 (0) 176 / 61380284

Rob Hand

unread,
May 9, 2014, 9:50:15 AM5/9/14
to vitadock-...@googlegroups.com, Rob Hand
Hi Clemens,

I switched the user profile query to use the same code as when I am querying the different modules data.
I still receive a 404 error though.

Server Response: HTTP Status 404 -
type Status report
message
description The requested resource () is not available.

Status Code: 404
GET https://cloud.vitadock.com/data/publicuser/sync?max=100&start=0&date_since=0
Headers: CaseInsensitiveDict({'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', 'Accept-Encoding': 'gzip, deflate, compress', 'Authorization': u'OAuth date_since="0",oauth_nonce="593651261722682041033497592795025880",oauth_timestamp="1399643337",max="100",oauth_consumer_key="FPSrwA349BZmcoblA72ycXyTM2VnbbTc55PihnKKRybd4sfMlTb8SC0dv4oiJywo",oauth_signature_method="HMAC-SHA256",oauth_version="1.0",oauth_token="9K870LL0emvUyCzevMJlrM3VJfn7jUxTdxhTabksjorn5LAgbGqscq1t4uWebWxz",oauth_signature="Ur50LDLNhlaxG5Bpn9SJIze7UoOLM4dnKEskf%2FgIvSM%3D",start="0"', 'User-Agent': 'python-requests/1.2.3 CPython/2.7.3 Linux/3.2.0-56-generic'})

Regards,
Rob

Clemens Lode

unread,
May 9, 2014, 9:56:04 AM5/9/14
to Rob Hand, vitadock-...@googlegroups.com
Hi Rob,

Try publicusers (with s)

Also, you should check your Authorization string (
'Authorization': u'OAuth looks a little bit strange, and you don't have to include the URL parameters in the authorization string (date_since, start, max))

Best regards,
Clemens


To unsubscribe from this group and stop receiving emails from it, send an email to vitadock-online...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Rob Hand

unread,
May 9, 2014, 10:01:00 AM5/9/14
to Clemens Lode, vitadock-...@googlegroups.com
Thanks for the quick reply Clemens that fixed it.
You might need to update wiki as it has it in the singular.

Rob
--
Rob Hand
Tictrac

Rob Hand

unread,
May 9, 2014, 11:16:49 AM5/9/14
to Clemens Lode, vitadock-...@googlegroups.com
Is there an additional access right required for the public user_id endpoint?
After changing url to the plural, I got a 401. I just assumed it was a token problem.
So I ran through the entire authentication flow, followed by a full data sync.
The user_id query fails but the rest succeed.

It gives the following errors message:
HTTP Status 401 - 401 No access right found.
type Status report
message 401 No access right found.
description This request requires HTTP authentication (401 No access right found.).


I checked the application configuration in the developer portal but I couldn't find any obvious access right that I need to add.
There was [Settings] User that I enabled but that didn't seem to solve the problem.
When I re-ran the entire auth flow and sync.

Any ideas?

Rob
--
Rob Hand
Tictrac

Clemens Lode

unread,
May 9, 2014, 11:46:46 AM5/9/14
to Rob Hand, vitadock-...@googlegroups.com
Hi Rob,

Oh, yes, there is the dropdown value missing.
I will add the access right to your application in a few hours myself.

Best regards,
Clemens

Clemens Lode

unread,
May 11, 2014, 4:16:49 PM5/11/14
to Rob Hand, vitadock-...@googlegroups.com

Unfortunately I have to update the servers and I'm busy on Monday and Tuesday. The interface will be up and running on Wednesday evening, maybe morning.

Best regards and sorry for the inconvenience,
Clemens

Reply all
Reply to author
Forward
0 new messages