locked
Possible to get the HealthVault User unique UUID using Android SDK RRS feed

  • Question

  • Hi

    I can get the unique UUID for the users for a particular HealthVault account using this code (see below). However i want to get the UUID for the owner of the HealthVault account. Is that possible? For my app i need to identify  who the HealthVault user is (only need UUID not the real info).

    Hope someone can help me here.

    Peter

    List<PersonInfo> personInfos = mHealthVaultService.getPersonInfoList();

    for (PersonInfo personInfo : personInfos)

    {

    Log.w("MFC", "====> HealthVault id: " + personInfo.getPersonId());

    }

    Saturday, August 17, 2013 8:30 AM

All replies

  • I got one step further using the latest android healthvault SDK library and trying to get the "GetPersonInfo" working to retrieve the id of the owner of a healthvault account. However i keep getting the following error:

    com.microsoft.hsg.HVAccessDeniedException: The authentication token element of the request is required for this method.

    or this one if i run the app again:

    com.microsoft.hsg.HVAccessDeniedException: Access is denied.

    I use this to get the sessionToken: connection.getSessionToken()
    and it is "fresh" as far as i know...

    I have checked the SODA rules for my appid as follows:
    Personal Contact Information 
    Basic Demographic Information 

    This is my code which i added to the HealthVaultService class. I tried to reset the account etc 

    I think the trouble is here:
    String userAuthToken = connection.getSessionToken();
    request.setUserAuthToken(userAuthToken);

    What is the correct token to be used in this call?

    public void getPersonInfo(){
        try
        {
            Connection connection = getConnection();
            HVAccessor accessor = new HVAccessor();
    
            Request request = new Request();
            request.setMethodName("GetPersonInfo");
    
            // We need the sessiontoken
            String userAuthToken = connection.getSessionToken();
    
            request.setUserAuthToken(userAuthToken);
    
            request.setInfo("<info><parameters/></info>");
            accessor.send(request, connection);
            Response response = accessor.getResponse();
    
            XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
            factory.setNamespaceAware(false);
            XmlPullParser parser = factory.newPullParser();
            parser.setInput(response.getInputStream(), "utf8");
    
            XmlUtils.nextStartTag(parser, "response");
            XmlUtils.nextStartTag(parser, "status");
            XmlUtils.skipSubTree(parser);
            XmlUtils.nextStartTag(parser, "wc:info");
            XmlUtils.nextStartTag(parser, "response-results");
    
            while (parser.nextTag() == XmlPullParser.START_TAG)
            {
                // to be done to parse the result
            }
        } catch (Exception e)
        {
                 throw new HVSystemException(e);
        }
        // return personInfoList;
    }
    Monday, August 19, 2013 10:58 AM