IdentityApiConnector の作成

名前空間: microsoft.graph

新しい identityApiConnector オブジェクトを作成 します。

アクセス許可

この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。

アクセス許可の種類 アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント) APIConnectors.ReadWrite.All
委任 (個人用 Microsoft アカウント) サポートされていません。
アプリケーション APIConnectors.ReadWrite.All

仕事または学校のアカウントは、次のいずれかの役割に属している必要があります。

  • グローバル管理者
  • 外部 ID ユーザー Flow管理者

HTTP 要求

POST /identity/apiConnectors

要求ヘッダー

名前 説明
Authorization ベアラー {token}。必須。
Content-Type application/json. Required.

要求本文

要求本文で、 identityApiConnector オブジェクトの JSON 表記を指定 します。

次の表に、identityApiConnector を作成するときに必要な プロパティを示します

プロパティ 説明
displayName String API コネクタの名前。
targetUrl String 呼び出す API エンドポイントの URL。
authenticationConfiguration apiAuthenticationConfigurationBase API を呼び出す認証構成の詳細を説明するオブジェクト。 基本認証PKCS 12 クライアント証明書が サポートされています。

応答

成功した場合、このメソッドは応答 201 Created コードと、応答本文 の identityApiConnector オブジェクトを返します。

例 1: 基本認証を使用して API コネクタを作成する

要求

要求の例を次に示します。

POST https://graph.microsoft.com/v1.0/identity/apiConnectors
Content-Type: application/json

{
    "displayName":"Test API",
    "targetUrl":"https://someapi.com/api",
    "authenticationConfiguration": {
      "@odata.type":"#microsoft.graph.basicAuthentication",
      "username": "MyUsername",
      "password": "MyPassword"
    }
}

応答

応答の例を次に示します。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。

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

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identity/apiConnectors/$entity",
    "id":"45715bb8-13f9-4bf6-927f-ef96c102d394",
    "displayName": "Test API",
    "targetUrl": "https://someapi.com/api",
    "authenticationConfiguration": {
        "@odata.type": "#microsoft.graph.basicAuthentication",
        "username": "MyUsername",
        "password": "******"
    }
}

例 2: クライアント証明書認証を使用して API コネクタを作成する

要求

要求の例を次に示します。

注: authenticationConfiguration 要求の種類は microsoft.graph.pkcs12certificate で、アップロードまたは作成に必要な証明書の構成を表します。

POST https://graph.microsoft.com/v1.0/identity/apiConnectors
Content-Type: application/json

{
    "displayName":"Test API",
    "targetUrl":"https://someotherapi.com/api",
    "authenticationConfiguration": {
        "@odata.type":"#microsoft.graph.pkcs12Certificate",
        "pkcs12Value": "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ...kDJ04sJShkkgjL9Bm49plA",
        "password": "CertificatePassword"
    }
}

応答

応答の例を次に示します。

注: authenticationConfiguration 応答の種類は microsoft.graph.clientCertificateAuthentication なので、アップロードされた証明書の公開情報を表します。

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

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identity/apiConnectors/$entity",
    "id":"45715bb8-13f9-4bf6-927f-ef96c102d394",
    "displayName": "Test API",
    "targetUrl": "https://someotherapi.com/api",
    "authenticationConfiguration": {
        "@odata.type": "#microsoft.graph.clientCertificateAuthentication",
        "certificateList": [
            {
                "thumbprint": "0EB255CC895477798BA418B378255204304897AD",
                "notAfter": 1666350522,
                "notBefore": 1508670522,
                "isActive": true
            }
        ]
    }
}