Posted by ashirchkov
Henagon

How to get all users email

Hello, we are trying to get user data through the application access level "Company" with maximum rights, but api returns data without mailboxes. In the documentation for api there is a mention of the "ReadEmail" access right, but nowhere in the interface are we found them. Mail is needed to match users of our portal and users of TeamViewer. How can we get the mail data of all users or where in the rights settings, you can add the right to read user mailboxes.

8 Replies
Posted by DomLan
Heptagon

Re: How to get all users email

Hi @ashirchkov

You could better expose the usage scenarios you anticipate.

Do you have created a script or an application key? The users you want to retrieve are included in your TeamViewer company? (i hope so)

Could you indicate the sequence of calls to TeamViewer APIs; you do not need to indicate authentication tokens, but only the parameters used in query queues (GETs) or in the request body (PUT, POST) and obviously api method address.

Regards

Domenico Langone
MCSD: App Builder
Posted by ashirchkov
Henagon

Re: How to get all users email

 I added a network api, the system generated client_id and client_secret. 
 
        $http = new HttpClient();
        /*Authorize*/
	$postData = array(
		'grant_type' => 'authorization_code',
		'code' => $_GET["code"],
		'redirect_uri' => 'www.example.com',
		'client_id' => $clientId,
		'client_secret' => $clientSecret
	);
	$response = $http->query('POST', 'https://webapi.teamviewer.com/api/v1/oauth2/token/', $postData);

          /*Get Users*/
	$http->setHeader('Authorization', 'Bearer '.$_GET['token']);
	$response = $http->query('GET', 'https://webapi.teamviewer.com/api/v1/users?full_list=true');

 

Posted by DomLan
Heptagon

Re: How to get all users email

Hi @ashirchkov

You mentioned the code, but you did not answer some of the previous questions. In practice you have not indicated the general view of what you want to get.

You should specify the scenario:
- do you want to query via API a set of data in your TeamViewer domain, with a Script Token?
- do you want to query via API a set of TeamViewer users data, also if not present in your TeamViewer domain, with OAuth authentication mode - public App (this scenario involves user's browser, TeamViewer web authentication system, and your web application)

The two scenarios are completely different.

Let me know.

Regards

Domenico Langone
MCSD: App Builder
Posted by ashirchkov
Henagon

Re: How to get all users email

i want query via API a set of data in my TeamViewer domain

Posted by DomLan
Heptagon

Re: How to get all users email

GET to /api/v1/users -> The answer does not provide this information.

You can get the data you requested by calling the GET method for the specific user, at least this is indicated in the example, although it is not actually reported as a return value. To be verified.

GET to /api/v1/users/<uxxxxxx> 

In your case, therefore, should iterate for each user returned from the first GET to /api/v1/users?full_list=true

Regards

Domenico Langone
MCSD: App Builder
Posted by ashirchkov
Henagon

Re: How to get all users email

This query (GET https://webapi.teamviewer.com/api/v1/users/u********) returns a data set without the email field

Posted by mLipok
Heptagon

Re: How to get all users email


@ashirchkov wrote:

This query (GET https://webapi.teamviewer.com/api/v1/users/u********) returns a data set without the email field


Did you solve this issue

Regards,
mLipok , AutoIt MVP

Did my reply answer your question? Accept it as a solution to help others.
Find this helpful? Say thanks by clicking on the Thumbs Up button.

Highlighted
Posted by DomLan
Heptagon

Re: How to get all users email

Hi to all,

changelog from v 13.0.1: Added return value “email” to 4.3.1 GET /api/v1/users (retrieve list of users). 

Regards

Domenico Langone
MCSD: App Builder