Share via


Profiles - Get

取得使用者設定檔。

GET https://app.vssps.visualstudio.com/_apis/profile/profiles/{id}?api-version=7.1-preview.3
GET https://app.vssps.visualstudio.com/_apis/profile/profiles/{id}?details={details}&withAttributes={withAttributes}&partition={partition}&coreAttributes={coreAttributes}&forceRefresh={forceRefresh}&api-version=7.1-preview.3

URI 參數

名稱 位於 必要 類型 Description
id
path True

string

相同組織內的目標使用者設定檔識別碼,或 「我」以取得目前已驗證使用者的設定檔。

api-version
query True

string

要使用的 API 版本。 這應該設定為 '7.1-preview.3',以使用此版本的 API。

coreAttributes
query

string

要傳回的核心配置檔案屬性逗號分隔清單。 有效值為 Email、Avatar、DisplayName 和 ContactWithOffers。

details
query

boolean

傳回公用設定檔資訊,例如顯示名稱、電子郵件地址、國家/地區等。如果為 false,則會忽略 withAttributes 參數。

forceRefresh
query

boolean

此版本的 API 中未使用。

partition
query

string

分割區 (要傳回的屬性) 具名群組。

withAttributes
query

boolean

如果為 true,則取得與設定檔相關聯之任意資料) (具名索引鍵/值組的屬性。 分割區參數也必須有值。

回應

名稱 類型 Description
200 OK

Profile

成功的作業

安全性

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

名稱 Description
vso.profile 授與讀取設定檔、帳戶、集合、專案、小組和其他最上層組織成品的能力。

範例

Sample Request

GET https://app.vssps.visualstudio.com/_apis/profile/profiles/{id}?api-version=7.1-preview.3

Sample Response

{
  "displayName": "Normal Paulk",
  "publicAlias": "d6245f20-2af8-44f4-9451-8107cb2767db",
  "emailAddress": "fabrikamfiber16@hotmail.com",
  "coreRevision": 1647,
  "timeStamp": "2014-05-12T22:23:07.727+00:00",
  "id": "d6245f20-2af8-44f4-9451-8107cb2767db",
  "revision": 1647
}

定義

名稱 Description
AttributeDescriptor

識別具有名稱和容器的屬性。

AttributesContainer

儲存一組具名配置檔案屬性。

CoreProfileAttribute

一律具有每個設定檔值的配置檔案屬性。

Profile

使用者設定檔。

ProfileAttribute

與設定檔相關聯的具名物件。

ProfileState

設定檔的目前狀態。

AttributeDescriptor

識別具有名稱和容器的屬性。

名稱 類型 Description
attributeName

string

屬性的名稱。

containerName

string

屬性所在的容器。

AttributesContainer

儲存一組具名配置檔案屬性。

名稱 類型 Description
attributes

<string,  ProfileAttribute>

容器所儲存的屬性。

containerName

string

容器的名稱。

revision

integer

容器內任何屬性的最大修訂編號。

CoreProfileAttribute

一律具有每個設定檔值的配置檔案屬性。

名稱 類型 Description
descriptor

AttributeDescriptor

屬性的描述項。

revision

integer

屬性的修訂編號。

timeStamp

string

上次變更屬性的時間。

value

string

屬性的值。

Profile

使用者設定檔。

名稱 類型 Description
applicationContainer

AttributesContainer

這個設定檔的屬性。

coreAttributes

<string,  CoreProfileAttribute>

這個設定檔的核心屬性。

coreRevision

integer

任何屬性的最大修訂編號。

id

string

設定檔的唯一識別碼。

profileState

ProfileState

設定檔的目前狀態。

revision

integer

任何屬性的最大修訂編號。

timeStamp

string

上次變更此設定檔的時間。

ProfileAttribute

與設定檔相關聯的具名物件。

名稱 類型 Description
descriptor

AttributeDescriptor

屬性的描述項。

revision

integer

屬性的修訂編號。

timeStamp

string

上次變更屬性的時間。

value

string

屬性的值。

ProfileState

設定檔的目前狀態。

名稱 類型 Description
custom

string

設定檔正在使用中。

customReadOnly

string

設定檔正在使用中,但只能讀取。

readOnly

string

設定檔只能讀取。