MSDN Archive Home
Help and FAQs
Get Authorized People
All Resource Updates
Change History (all pages)
Resource Page Description
Sample for GetAuthorizedPeople method
The API method GetAuthorizedPeople introduced in HealthVault platform release PB0903 enables applications to be able to retrieve the list of users who have authorized the application and their HealthVault context (stored in the PersonInfo object). Application can then choose to do bulk operations like SendInsecureMessage using the context of these users.
Here are the steps to use this method:
1. Create an application connection
2. Create a GetAuthorizedPeopleSettings Object
3. Different settings, including BatchSize, StartingPersonId, and AuthorizationsCreatedSince can be set.
4. Use the connection to call GetAuthorizedPeople by passing in the GetAuthorizedPeopleSetting Object
Below is a prototype sample:
public void GetAuthorizedPeopleSetBatchSize()
Int32 numResults = 1;
Guid appId = new Guid("9ca84d74-1473-471d-940f-2699cb7198df");
// Create an application connection
WebApplicationCredential cred = new
AuthenticatedConnection conn = new AuthenticatedConnection(cred);
// Create a GetAuthorizedPeopleSettings Object
GetAuthorizedPeopleSettings settings = new
// Set BatchSize
settings.BatchSize = numResults;
// This will return the list of PersonInfo for the users that
// authorized records with the application
List<PersonInfo> resultPersonInfos =
Mar 4 2009 at 12:31 AM
, version 7
Mar 5 2009 at 7:39 PM
Awesome feature. I'm getting the following exception:
[Microsoft.Health.HealthServiceAccessDeniedException] : "The application does not have permission to call the specified method."
Is there a specific application permission required for this feature?
Mar 5 2009 at 11:49 PM
hi there -
Please refere to http://social.msdn.microsoft.com/Forums/en-US/healthvault/thread/5faa91af-d51b-40bb-8501-fce2e2b5a1fc
Appending it here:
The method "GetAuthorizedPeople" is part of our method group x-BaseMethods. I think that you had an application configured with individiual methods (this is was the case with applications registered Pre-October 08). If you go to the application configuration center's method tab (http://conig.healthvault-ppe.com) and update your application method (just by hitting submit and without changing any check marks), your application will have the x-BaseMethods group (it corresponds to the first item greyed item "Basic Set"). Please note: changes to application configuration take up to 30 minutes.
We also updated our Hello World application to have these methods. Here is the sample which would work with HelloWorld (please note - dont use HelloWorld for this, as it has a tonne of use and the GetAuthorizedPeople method attempts to get them..and hence takes a long time).
Mar 5 2009 at 11:56 PM
Yes, now it works. Thanks VaibhavB!
Sign in to add a comment
Tue Mar 3 2009 at 8:00 AM
More Tags ...
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Manage Your Profile
MSDN Flash Newsletter
© 2008 Microsoft Corporation. All rights reserved.