简体   繁体   English

如何从Microsoft Graph API for Office 365获取国家/地区?

[英]How to get country from Microsoft Graph API for Office 365?

I want to fetch country of the logged in user using Graph API of Microsoft for Office 365. 我想使用Microsoft的Office 365的Graph API提取登录用户的国家/地区。

I have downloaded code snippets for Microsoft Graph API in which I checked about the same. 我已经下载了Microsoft Graph API的代码段,并在其中进行了检查。 But it seems there is no any way to get it. 但是似乎没有任何办法可以得到它。

Is it possible to fetch country using Graph API? 是否可以使用Graph API获取国家/地区? If yes then what process should I follow? 如果是,那我应该遵循什么程序?

There is a country property on the User Object, which is not required to be populated. 用户对象上有一个国家/地区属性,不需要填充。 There is also 'preferredLanugage', 'postalCode', etc... check them all out here 还有“ preferredLanugage”,“ postalCode”等...请在此处全部检查

Here is an example of a graph api request to get the country code of the logged in user, using the 'me' endpoint: 这是一个图形api请求的示例,该示例使用'me'端点获取登录用户的国家/地区代码:

https://graph.windows.net/me/country

You can try it using the Graph Explorer (Note you will have to be signed in for this to work.) 您可以使用Graph Explorer尝试一下(请注意,您必须先登录才能正常使用。)

More information on how to do stuff with a signed in user here . 有关如何使用已登录用户执行操作的更多信息,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Microsoft Graph Api 获取 Office 365 的邮件大小? - How to get the message size of Office 365 using Microsoft Graph Api? Microsoft Graph API office 365:是否可以从 Graph 中获取邮件 MIME 类型 - Microsoft Graph API office 365 : Is it possible to get Mail MIME type from the Graph 尝试使用Microsoft Graph API获取Office 365帐户的联系人 - Trying to get Contacts for an Office 365 account using Microsoft Graph API 如何使用 Microsoft Graph API 获取 Office365 邮件的 MIME 内容? - How to get MIME content of Office365 mail using Microsoft Graph API? 如果为Office 365租户禁用了办公图,Microsoft Graph API是否可以工作? - Will Microsoft Graph API work if office graph is disabled for the Office 365 tenant? 来自javascript的office 365 graph api:如何正确验证 - office 365 graph api from javascript: how to properly authenticate Microsoft Graph API Office 365-如何使用REST API更改消息标志属性? - Microsoft Graph API Office 365 - How change message flags property with REST API? 使用服务主体登录Microsoft Graph / Office 365 REST API - Microsoft Graph / Office 365 REST API login with service principal Microsoft Graph - Office 365 API,获取有关邮箱的信息 - Microsoft Graph - Office 365 API , Obtain Information about mailbox 使用 Microsoft Graph 进行 Office 365 身份验证 - Office 365 Authentication with Microsoft Graph
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM