创建 sourceSystemDefinition

命名空间:microsoft.graph.industryData

重要

Microsoft Graph 中版本下的 /beta API 可能会更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 在 v1.0 中是否可用,请使用 版本 选择器。

创建新的 sourceSystemDefinition 对象。

权限

调用此 API 需要以下权限之一。 若要了解详细信息,包括如何选择权限的信息,请参阅权限

权限类型 权限(从最低特权到最高特权)
委派(工作或学校帐户) IndustryData-SourceSystem.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。
应用程序 IndustryData-SourceSystem.ReadWrite.All

HTTP 请求

POST /external/industryData/sourceSystems

请求标头

名称 说明
Authorization 持有者 {token}。 必填。
Content-Type application/json. 必需。

请求正文

在请求正文中,提供 microsoft.graph.industryData.sourceSystemDefinition 对象的 JSON 表示形式。

创建 sourceSystemDefinition 时,可以指定以下属性。

属性 类型 说明
displayName String 源系统的名称。 支持的最大长度为 100 个字符。 必填。
userMatchingSettings microsoft.graph.industryData.userMatchingSetting 集合 roleGroup 的用户匹配设置的集合。 可选。
供应商 String 提供源系统的供应商的名称。 支持的最大长度为 100 个字符。 可选。

响应

如果成功,此方法在 201 Created 响应正文中返回响应代码和 microsoft.graph.industryData.sourceSystemDefinition 对象。

示例

请求

请求示例如下所示。

POST https://graph.microsoft.com/beta/external/industryData/sourceSystems
Content-Type: application/json
Content-length: 250

{
  "displayName": "Rostering source",
  "userMatchingSettings": [
    {
      "matchTarget": {
        "code": "userPrincipalName"
      },
      "priorityOrder": 0,
      "roleGroup@odata.bind": "https://graph.microsoft.com/beta/external/industryData/roleGroups/staff",
      "sourceIdentifier": {
        "code": "username"
      }
    },
    {
      "matchTarget": {
        "code": "userPrincipalName"
      },
      "priorityOrder": 1,
      "roleGroup@odata.bind": "https://graph.microsoft.com/beta/external/industryData/roleGroups('students')",
      "sourceIdentifier": {
        "code": "username"
      }
    }
  ]
}

响应

下面展示了示例响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 201 Created
Content-Type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#external/industryData/sourceSystems/$entity",
    "id": "aa050107-5784-4a8e-1876-08daddab21bc",
    "displayName": "Rostering source",
    "vendor": null,
    "userMatchingSettings": [
        {
            "priorityOrder": 0,
            "sourceIdentifier": {
                "code": "username"
            },
            "matchTarget": {
                "code": "userPrincipalName"
            }
        },
        {
            "priorityOrder": 1,
            "sourceIdentifier": {
                "code": "username"
            },
            "matchTarget": {
                "code": "userPrincipalName"
            }
        }
    ]
}