获取 organizationalBrandingPropertiesGet organizationalBrandingProperties

重要

Microsoft Graph /beta 中版本下的 API 可能会更改。APIs under the /beta version in Microsoft Graph are subject to change. 不支持在生产应用程序中使用这些 API。Use of these APIs in production applications is not supported. 若要确定 API 在 v1.0 中是否可用,请使用 版本选择 器。To determine whether an API is available in v1.0, use the Version selector.

检索 organizationalBrandingProperties 对象的属性和 关系。Retrieve the properties and relationships of an organizationalBrandingProperties object.

权限Permissions

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

权限类型Permission type 权限(从最低特权到最高特权)Permissions (from least to most privileged)
委派(工作或学校帐户)Delegated (work or school account) Organization.Read.All、User.Read、User.Read.All、User.ReadBasic.AllOrganization.Read.All, User.Read, User.Read.All, User.ReadBasic.All
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) 不支持。Not supported.
应用程序Application 不支持。Not supported.

HTTP 请求HTTP request

GET /organization/{id}/branding

可选的查询参数Optional query parameters

此方法支持一些 OData 查询参数来帮助自定义响应。This method supports some of the OData query parameters to help customize the response. 若要了解一般信息,请参阅 OData 查询参数For general information, see OData query parameters.

请求标头Request headers

名称Name 说明Description
AuthorizationAuthorization Bearer {token}。必需。Bearer {token}. Required.

备注

如果在 Graph 浏览器中尝试查询,还必须包含具有有效 ISO-639 Accept-Language请求标头。If you try the query in Graph Explorer, you must also include the Accept-Language request header with a valid ISO-639 locale.

请求正文Request body

请勿提供此方法的请求正文。Do not supply a request body for this method.

响应Response

如果成功,此方法在响应正文中返回 响应代码和请求的 200 OK organizationalBrandingProperties 对象。If successful, this method returns a 200 OK response code and the requested organizationalBrandingProperties object in the response body.

示例Examples

示例 1:获取默认品牌Example 1: Get the default branding

备注

如果尝试 Graph 资源管理器中的示例,还必须包含具有有效 ISO-639 区域设置的 Accept-Language 请求标头,以避免收到错误"无效区域设置 id 值 en-US,en;q=0.9"。If you try the example in Graph Explorer, you must also include the Accept-Language request header with a valid ISO-639 locale to avoid getting an error "Invalid locale id value en-US,en;q=0.9. 它必须是有效的 ISO-639 区域设置。"It must be a valid ISO-639 locale."

请求Request

下面展示了示例请求。The following is an example of the request.

GET https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding

响应Response

下面展示了示例响应。The following is an example of the response.

注意: 为了提高可读性,可能缩短了此处显示的响应对象。所有属性都将通过实际调用返回。Note: The response object shown here might be shortened for readability. All the properties will be returned from an actual call.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "backgroundColor":"#FFFF33",
  "backgroundImage@odata.mediaContentType":"image/*",
  "backgroundImage@odata.mediaReadLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/backgroundImage",
  "backgroundImage@odata.mediaEditLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/backgroundImage",
  "bannerLogo@odata.mediaContentType":"image/*",
  "bannerLogo@odata.mediaReadLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/bannerLogo",
  "bannerLogo@odata.mediaEditLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/bannerLogo",
  "id": "und",
  "squareLogo@odata.mediaContentType":"image/*",
  "squareLogo@odata.mediaReadLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/squareLogo",
  "squareLogo@odata.mediaEditLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/squareLogo",
  "signInPageText":"Default",
  "usernameHintText":"DefaultHint"
}

对 /branding 的请求始终返回 mediaContentType、mediaReadLinkmediaEditLink 属性。 Requests for /branding always return the mediaContentType, mediaReadLink, and mediaEditLink properties. 如果已应用区域设置,则 mediaEditLink 为区域设置 ((始终为非 null) )的 mediaEditLink; 如果区域设置的 mediaReadLink 为非 null,则 mediaReadLinkmediaContentType 为区域设置中的 mediaReadLinkmediaContentType; 否则,默认 mediaReadLinkmediaContentTypeIf a locale has been applied, the mediaEditLink is the mediaEditLink for the locale (which is always non-null), and the mediaReadLink and mediaContentType are the mediaReadLink and mediaContentType of the locale if the mediaReadLink of the locale is non-null; otherwise, the default mediaReadLink and mediaContentType.

示例 2:获取组织品牌,但没有配置品牌Example 2: Get organizational branding but no branding configured

请求Request

下面展示了示例请求。The following is an example of the request.

GET https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding

响应Response

下面展示了示例响应。The following is an example of the response.

HTTP/1.1 404 NOT FOUND

示例 3:获取法语区域设置的组织品牌Example 3: Get organizational branding for the French locale

the Accept-Langauge header is used to apply a particular localization to the branding.The Accept-Langauge header is used to apply a particular localization to the branding. 指定本地化中为 null 的属性从默认品牌返回。Properties that are null in the specified localization are returned from the default branding. 如果在Accept-Language中指定了内容语言标头,响应将包含 Content-Language 标头,除非是 undIf the Accept-Language header is specified in the request, the response will include the Content-Language header, unless it is und.

请求Request

下面展示了示例请求。The following is an example of the request.

GET https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding
Accept-Language: fr

响应Response

下面展示了示例响应。The following is an example of the response.

注意: 为了提高可读性,可能缩短了此处显示的响应对象。所有属性都将通过实际调用返回。Note: The response object shown here might be shortened for readability. All the properties will be returned from an actual call.

HTTP/1.1 200 OK
Content-Type: application/json
Content-Language: fr

{
    "backgroundColor":"#00000F",
    "backgroundImage@odata.mediaContentType":"image/*",
    "backgroundImage@odata.mediaReadLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/backgroundImage",
    "backgroundImage@odata.mediaEditLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/localizations/fr/backgroundImage",
    "bannerLogo@odata.mediaContentType":"image/*",
    "bannerLogo@odata.mediaReadLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/bannerLogo",
    "bannerLogo@odata.mediaEditLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/localizations/fr/bannerLogo",
    "id": "und",
    "squareLogo@odata.mediaContentType":"image/*",
    "squareLogo@odata.mediaReadLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/squareLogo",
    "squareLogo@odata.mediaEditLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/localizations/fr/squareLogo",
    "signInPageText":"Default",
    "usernameHintText":"DefaultHint"
}

示例 4:获取法语区域设置的 bannerLogoExample 4: Get bannerLogo for the French locale

如果 fr 区域设置存在,则返回 bannerLogo。Returns bannerLogo for the fr locale if it exists. 如果本地化不存在,则返回默认的 bannerLogoIf the localization does not exist, returns the default bannerLogo.

请求Request

下面展示了示例请求。The following is an example of the request.

GET https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/bannerLogo
Accept-Language: fr

响应Response

下面展示了示例响应。The following is an example of the response.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "bannerLogo@odata.mediaContentType":"image/*",
    "bannerLogo@odata.mediaReadLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/bannerLogo",
    "bannerLogo@odata.mediaEditLink": "https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/localizations/fr/bannerLogo",
}

示例 5:在未配置 bannerLogo 时获取 bannerLogoExample 5: Get bannerLogo when no bannerLogo is configured

本示例显示对默认品牌或页面标题中指定的语言中不存在Accept-Language的请求。This example shows a request for a property that does not exist on the default branding or the language specified in the Accept-Language header.

请求Request

下面展示了示例请求。The following is an example of the request.

GET https://graph.microsoft.com/beta/organization/d69179bf-f4a4-41a9-a9de-249c0f2efb1d/branding/bannerLogo
Accept-Language: de

响应Response

下面展示了示例响应。The following is an example of the response.

HTTP/1.1 204 NO CONTENT