製品在庫オープン API

  • リリースバージョン: Xanadu
  • 更新日 2024年08月01日
  • 所要時間:72分
  • 製品在庫オープン API は、製品在庫を作成および取得するためのエンドポイントを提供します。

    この API を使用して、外部システムと Now Platform の間で製品在庫情報を管理します。

    この API は、ServiceNow Store で入手可能な Product Inventory Advanced アプリケーションに含まれています。

    この API は、 sn_prd_invt 名前空間内で提供されます。

    呼び出し元ユーザーには、sn_prd_invt.product_inventory_integrator ロールが必要です。

    この API は、次のテーブルのデータを作成および更新します。
    • 製品特性 [sn_prd_invt_product_characteristics]
    • 製品在庫 [sn_prd_invt_product_inventory]
    • 製品モデル [cmdb_model]
    • 製品モデル特性 [sn_prd_pm_product_model_characteristic]

    製品在庫オープン API は、TM Forum Product Inventory Management API REST 仕様の ServiceNow® 実装です。この実装は、TMF637 Product Inventory Management API REST Specification Release 19 (2019 年 8 月) に基づいています。製品在庫オープン API は、TM Forum によって適合性が認定されています。

    TMF 適合ロゴ

    製品在庫オープン API - GET /sn_prd_invt/product

    すべての製品在庫のリストを取得します。

    URL 形式

    デフォルトの URL:api/sn_prd_invt/product

    サポートされている要求パラメーター

    表 : 1. パスパラメーター
    名前 説明
    なし
    表 : 2. クエリパラメータ
    名前 説明
    customer 顧客別に製品在庫をフィルタリングします。顧客の sys_id または外部 ID がこのパラメーターの値に一致する製品オファリングのみが応答で返されます。

    データタイプ:文字列

    fields 応答で返すフィールドのリスト。無効なフィールドは無視されます。 このパラメーターを使用しない場合、すべてのフィールドが返されます。

    データタイプ:文字列

    limit 返されるレコードの最大数。このレコード数を超える要求の場合は、offset パラメーターを使用してレコード取得をページネーションします。

    デフォルト:20

    最大:100

    データタイプ:数値

    offset レコードの取得を開始する開始インデックス。この値を使用して、レコード取得をページネーションします。この機能により、レコード数に関係なく、管理しやすい小さなチャンクに分割してすべてのレコードを取得できます。

    デフォルト:0

    データタイプ:数値

    place 場所別に製品在庫をフィルタリングします。場所の sys_id または外部 id がこのパラメーターの値に一致する製品オファリングのみが応答で返されます。

    データタイプ:文字列

    status ステータス別に製品在庫をフィルタリングします。ステータスがこのパラメーターの値に一致する製品在庫のみが応答で返されます。

    データタイプ:文字列

    表 : 3. 要求本文パラメーター (JSON)
    名前 説明
    なし

    ヘッダー

    次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 サポートされている REST API ヘッダー」を参照してください。

    表 : 4. 要求ヘッダー
    ヘッダー 説明
    なし
    表 : 5. 応答ヘッダー
    ヘッダー 説明
    Content-Range ページネーションされた呼び出しで返されるコンテンツの範囲を指定します。

    たとえば、offset=2 および limit=3 の場合、Content-Range ヘッダーの値は items 3-5 です。

    Content-Type 応答本文のデータフォーマット。application/json のみをサポートします。
    X-Total-Count ページネーションされたクエリの場合、このヘッダーはサーバーで利用可能なレコードの合計数を指定します。

    ステータスコード

    この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 REST API HTTP 応答コード」を参照してください。

    表 : 6. ステータスコード
    ステータスコード 説明
    200 要求が正常に処理されました。応答で完全なリソースが返されました (ページネーションなし)。
    206 応答で部分的なリソースが返されました (ページネーションあり)。
    400
    要求が正しくありません。考えられる理由:
    • 無効なパスパラメーター
    • 無効な URI
    404 レコードが見つかりません。クエリパラメーターに一致するレコードがテーブルに見つかりません。

    応答本文のパラメーター (JSON)

    名前 説明
    href 製品在庫レコードへの相対リンク。

    データタイプ:文字列

    ID 製品在庫 [sn_prd_invt_product_inventory] テーブルの製品在庫の sys_id。

    データタイプ:文字列

    name 製品在庫の名前。

    データタイプ:文字列

    place 製品に関連付けられた場所。

    データタイプ:文字列

    productCharacteristic 製品特性のリスト。

    データタイプ:アレイ

    "productCharacteristic": [
      {
        "name": "String",
        "value": "String"
      }
    ]
    productCharacteristic.name 特性の名前。

    データタイプ:文字列

    productCharacteristic.value 特性の値。

    データタイプ:文字列

    productOffering 製品在庫が関連付けられている製品オファリング。

    データタイプ:オブジェクト

    "productOffering": {
       "id": "String",
       "internalId": "String",
       "internalVersion": "String",
       "name": "String",
       "version": "String"
    }
    productOffering.id 製品オファリングの initial_version または external_id。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.internalId 製品オファリングの initial_version。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.internalVersion 製品オファリングのバージョン。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.name 製品オファリングの名前。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.version 製品オファリングの external_version。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productPrice 空のアレイを返します。

    データタイプ:アレイ

    productRelationship 関連製品のリスト。

    データタイプ:アレイ

    "productRelationship": [
      {
        "productId": "String",
        "relationshipType": "String"
      }
    ]
    productRelationship.productId 製品在庫 [sn_prd_invt_product_inventory] テーブルの関連製品の sys_id。

    データタイプ:文字列

    productRelationship.relationshipType 関係のタイプ。

    データタイプ:文字列

    productSpecification 製品の製品仕様。

    データタイプ:オブジェクト

    "productSpecification": {
      "id": "String",
      "internalId": "String",
      "internalVersion": "String",
      "version": "String"
    }
    productSpecification.id 製品仕様の initial_version または external_id。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    productSpecification.internalId 製品仕様の initial_version。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    productSpecification.internalVersion 製品仕様のバージョン。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    productSpecification.version 製品仕様の external_version。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    realizingResource 製品を実現するリソース。実現のためのリソースは、この製品在庫の子製品在庫です。

    データタイプ:オブジェクト

    "realizingResource": {
      "id": "String",
      "type": "String"
    }
    realizingResource.id 実現のためのリソースの sys_id。製品在庫 [sn_prd_invt_product_inventory] テーブルにあります。

    データタイプ:文字列

    realizingResource.type 実現のためのリソースのタイプ。

    有効な値:child

    データタイプ:文字列

    realizingService 製品を実現するサービス。実現のためのサービスは、この製品在庫の子製品在庫です。

    データタイプ:オブジェクト

    "realizingService": {
      "id": "String",
      "type": "String"
    }
    realizingService.id 実現のためのサービスの sys_id。製品在庫 [sn_prd_invt_product_inventory] テーブルにあります。

    データタイプ:文字列

    realizingService.type 実現のためのサービスのタイプ。

    有効な値:child

    データタイプ:文字列

    relatedParty チケットに関連付けられている関係者のリスト。

    データタイプ:アレイ

    "relatedParty": [
       {
          "id": "String",
          "@referredType": "String"
       }
    ]
    relatedParty.id チケットに関連付けられているアカウントまたは顧客連絡先の sys_id。アカウント [customer_account]、連絡先 [customer_contact]、またはコンシューマー [csm_consumer] テーブルにあります。

    データタイプ:文字列

    relatedParty.@referredType 顧客のタイプ。
    可能な値:
    • Customer
    • CustomerContact
    • コンシューマー

    データタイプ:文字列

    state 製品の現在のステータス。

    データタイプ:文字列

    cURL 要求

    この例では、すべての製品在庫を取得します。

    curl --location --request GET "https://instance.service-now.com/api/sn_prd_invt/product" \
    --user 'username':'password'

    応答本文。

    [
       {
          "id": "037fd87ec3603010abc8b5183c40ddf2",
          "relatedParty": [
             {
                "id": "ffc68911c35420105252716b7d40dd55",
                "name": "Example Company",
                "@type": "RelatedParty",
                "@referredType": "Customer"
             },
             {
                "id": "eaf68911c35420105252716b7d40ddde",
                "name": "Sally Thomas",
                "@type": "RelatedParty",
                "@referredType": "CustomerContact"
             }
          ],
          "name": "Routing and Configuration PI0000318",
          "productSpecification": {
             "id": "aec57e981bb420106ba59acf034bcb08",
             "name": "Routing and Configuration",
             "version": "",
             "internalVersion": "1",
             "internalId": "aec57e981bb420106ba59acf034bcb08"
          },
          "status": "Active",
          "productOffering": {
             "id": "69017a0f536520103b6bddeeff7b127d",
             "name": "Premium SD-WAN Offering",
             "version": "",
             "internalVersion": "1",
             "internalId": "69017a0f536520103b6bddeeff7b127d"
          },
          "product": "ce0b52c7532520103b6bddeeff7b12f5",
          "place": {
             "id": "25ab9c4d0a0a0bb300f7dabdc0ca7c1c",
             "name": "100 South Charles Street, Baltimore,MD"
          },
          "productCharacteristic": [],
          "productRelationship": [],
          "realizingService": [],
          "realizingResource": [
             {
                "id": "9b2fa60b536520103b6bddeeff7b1233",
                "name": "Route Target"
             }
          ],
          "productPrice": [],
          "href": "/api/sn_prd_invt/product/037fd87ec3603010abc8b5183c40ddf2",
          "billingAccount": "Not Specified."
       }
    ]

    製品在庫オープン API - GET /sn_prd_invt/product/{id}

    指定された製品在庫レコードを取得します。

    URL 形式

    デフォルトの URL:/api/sn_prd_invt/product/{id}

    サポートされている要求パラメーター

    表 : 7. パスパラメーター
    名前 説明
    ID 取得する製品在庫の sys_id。製品在庫 [sn_prd_invt_product_inventory] テーブルにあります。

    データタイプ:文字列

    表 : 8. クエリパラメーター
    名前 説明
    customer 顧客別に製品在庫をフィルタリングします。顧客の sys_id または外部 id がこのパラメーターの値に一致する製品オファリングのみが応答で返されます。

    データタイプ:文字列

    fields 応答で返すフィールドのリスト。無効なフィールドは無視されます。このパラメーターを使用しない場合、すべてのフィールドが返されます。

    データタイプ:文字列

    place 場所別に製品在庫をフィルタリングします。場所の sys_id または外部 id がこのパラメーターの値に一致する製品オファリングのみが応答で返されます。

    データタイプ:文字列

    status ステータス別に製品在庫をフィルタリングします。ステータスがこのパラメーターの値に一致する製品在庫のみが応答で返されます。

    データタイプ:文字列

    表 : 9. 要求本文パラメーター (JSON)
    名前 説明
    なし

    ヘッダー

    次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 サポートされている REST API ヘッダー」を参照してください。

    表 : 10. 要求ヘッダー
    ヘッダー 説明
    なし
    表 : 11. 応答ヘッダー
    ヘッダー 説明
    Content-Type 応答本文のデータフォーマット。application/json のみをサポートします。

    ステータスコード

    この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 REST API HTTP 応答コード」を参照してください。

    表 : 12. ステータスコード
    ステータスコード 説明
    200 要求が正常に処理されました。
    400
    要求が正しくありません。以下のいずれかの理由が考えられます。
    • 無効なパスパラメーター
    • 無効な URI
    404 レコードが見つかりません。ID に関連付けられたレコードがテーブルに見つかりません。

    応答本文のパラメーター (JSON)

    名前 説明
    href 製品在庫レコードへの相対リンク。

    データタイプ:文字列

    ID 製品在庫 [sn_prd_invt_product_inventory] テーブルの製品在庫の sys_id。

    データタイプ:文字列

    name 製品在庫の名前。

    データタイプ:文字列

    place 製品に関連付けられた場所。

    データタイプ:文字列

    productCharacteristic 製品特性のリスト。

    データタイプ:アレイ

    "productCharacteristic": [
       {
          "name": "String",
          "value": "String"
       }
    ]
    productCharacteristic.name 特性の名前。

    データタイプ:文字列

    productCharacteristic.value 特性の値。

    データタイプ:文字列

    productOffering 製品在庫が関連付けられている製品オファリング。

    データタイプ:オブジェクト

    "productOffering": {
       "id": "String",
       "internalId": "String",
       "internalVersion": "String",
       "name": "String",
       "version": "String"
    }
    productOffering.id 製品オファリングの initial_version または external_id。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.internalId 製品オファリングの initial_version。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.internalVersion 製品オファリングのバージョン。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.name 製品オファリングの名前。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.version 製品オファリングの external_version。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productPrice 空のアレイを返します。

    データタイプ:アレイ

    productRelationship 関連製品のリスト。

    データタイプ:アレイ

    "productRelationship": [
       {
          "productId": "String",
          "relationshipType": "String"
       }
    ]
    productRelationship.productId 製品在庫 [sn_prd_invt_product_inventory] テーブルの関連製品の sys_id。

    データタイプ:文字列

    productRelationship.relationshipType 関係のタイプ。

    データタイプ:文字列

    productSpecification 製品の製品仕様。

    データタイプ:オブジェクト

    "productSpecification": {
      "id": "String",
      "internalId": "String",
      "internalVersion": "String",
      "version": "String"
    }
    productSpecification.id 製品仕様の initial_version または external_id。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    productSpecification.internalId 製品仕様の initial_version。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    productSpecification.internalVersion 製品仕様のバージョン。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    productSpecification.version 製品仕様の external_version。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    realizingResource 製品を実現するリソース。実現のためのリソースは、この製品在庫の子製品在庫です。

    データタイプ:オブジェクト

    "realizingResource": {
      "id": "String",
      "type": "String"
    }
    realizingResource.id 実現のためのリソースの sys_id。製品在庫 [sn_prd_invt_product_inventory] テーブルにあります。

    データタイプ:文字列

    realizingResource.type 実現のためのリソースのタイプ。

    有効な値:child

    データタイプ:文字列

    realizingService 製品を実現するサービス。実現のためのサービスは、この製品在庫の子製品在庫です。

    データタイプ:オブジェクト

    "realizingService": {
      "id": "String",
      "type": "String"
    }
    realizingService.id 実現のためのサービスの sys_id。製品在庫 [sn_prd_invt_product_inventory] テーブルにあります。

    データタイプ:文字列

    realizingService.type 実現のためのサービスのタイプ。

    有効な値:child

    データタイプ:文字列

    relatedParty チケットに関連付けられている関係者のリスト。

    データタイプ:アレイ

    "relatedParty": [
      {
        "id": "String",
        "@referredType": "String"
      }
    ]
    relatedParty.id チケットに関連付けられているアカウントまたは顧客連絡先の sys_id。アカウント [customer_account]、連絡先 [customer_contact]、またはコンシューマー [csm_consumer] テーブルにあります。

    データタイプ:文字列

    relatedParty.@referredType 顧客のタイプ。

    データタイプ:文字列

    state 製品の現在のステータス。

    データタイプ:文字列

    cURL 要求

    この例では、指定された製品在庫を取得します。

    curl -X GET 'https://instance.service-now.com/api/sn_prd_invt/product/037fd87ec3603010abc8b5183c40ddf2' \
    --user 'username':'password'

    出力:

    {
       "id": "037fd87ec3603010abc8b5183c40ddf2",
       "relatedParty": [
          {
             "id": "ffc68911c35420105252716b7d40dd55",
             "name": "Example Company",
             "@type": "RelatedParty",
             "@referredType": "Customer"
          },
          {
             "id": "eaf68911c35420105252716b7d40ddde",
             "name": "Sally Thomas",
             "@type": "RelatedParty",
             "@referredType": "CustomerContact"
          }
       ],
       "name": "Routing and Configuration PI0000318",
       "productSpecification": {
          "id": "aec57e981bb420106ba59acf034bcb08",
          "name": "Routing and Configuration",
          "version": "",
          "internalVersion": "1",
          "internalId": "aec57e981bb420106ba59acf034bcb08"
       },
       "status": "Active",
       "productOffering": {
          "id": "69017a0f536520103b6bddeeff7b127d",
          "name": "Premium SD-WAN Offering",
          "version": "",
          "internalVersion": "1",
          "internalId": "69017a0f536520103b6bddeeff7b127d"
       },
       "product": "ce0b52c7532520103b6bddeeff7b12f5",
       "place": {
          "id": "25ab9c4d0a0a0bb300f7dabdc0ca7c1c",
          "name": "100 South Charles Street, Baltimore,MD"
       },
       "productCharacteristic": [],
       "productRelationship": [],
       "realizingService": [],
       "realizingResource": [
          {
             "id": "9b2fa60b536520103b6bddeeff7b1233",
             "name": "Route Target"
          }
       ],
       "productPrice": [],
       "href": "/api/sn_prd_invt/product/037fd87ec3603010abc8b5183c40ddf2",
       "billingAccount": "Not Specified."
    }

    製品在庫オープン API - GET /sn_prd_invt/productinventory

    すべての製品在庫のリストを取得します。

    重要:
    Tokyo リリース以降、このエンドポイントは廃止されました。このエンドポイントの新しいバージョンは 製品在庫オープン API - GET /sn_prd_invt/product です。

    URL 形式

    デフォルトの URL:api/sn_prd_invt/productinventory

    サポートされている要求パラメーター

    表 : 13. パスパラメーター
    名前 説明
    なし
    表 : 14. クエリパラメータ
    名前 説明
    customer 顧客別に製品在庫をフィルタリングします。顧客の sys_id または外部 id がこのパラメーターの値に一致する製品オファリングのみが応答で返されます。

    データタイプ:文字列

    fields 応答で返すフィールドのリスト。無効なフィールドは無視されます。このパラメーターを使用しない場合、すべてのフィールドが返されます。

    データタイプ:文字列

    limit 返されるレコードの最大数。このレコード数を超える要求の場合は、offset パラメーターを使用してレコード取得をページネーションします。

    デフォルト:20

    最大:100

    データタイプ:数値

    offset レコードの取得を開始する開始インデックス。この値を使用して、レコード取得をページネーションします。この機能により、レコード数に関係なく、管理しやすい小さなチャンクに分割してすべてのレコードを取得できます。

    デフォルト:0

    データタイプ:数値

    place 場所別に製品在庫をフィルタリングします。場所の sys_id または外部 id がこのパラメーターの値に一致する製品オファリングのみが応答で返されます。

    データタイプ:文字列

    status ステータス別に製品在庫をフィルタリングします。ステータスがこのパラメーターの値に一致する製品在庫のみが応答で返されます。

    データタイプ:文字列

    表 : 15. 要求本文パラメーター (JSON)
    名前 説明
    なし

    ヘッダー

    次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 サポートされている REST API ヘッダー」を参照してください。

    表 : 16. 要求ヘッダー
    ヘッダー 説明
    なし
    表 : 17. 応答ヘッダー
    ヘッダー 説明
    Content-Range ページネーションされた呼び出しで返されるコンテンツの範囲を指定します。

    たとえば、offset=2 および limit=3 の場合、Content-Range ヘッダーの値は items 3-5 です。

    Content-Type 応答本文のデータフォーマット。application/json のみをサポートします。
    X-Total-Count ページネーションされたクエリの場合、このヘッダーはサーバーで利用可能なレコードの合計数を指定します。

    ステータスコード

    この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 REST API HTTP 応答コード」を参照してください。

    表 : 18. ステータスコード
    ステータスコード 説明
    200 要求が正常に処理されました。応答で完全なリソースが返されました (ページネーションなし)。
    206 応答で部分的なリソースが返されました (ページネーションあり)。
    400
    要求が正しくありません。考えられる理由:
    • 無効なパスパラメーター
    • 無効な URI
    404 レコードが見つかりません。クエリパラメーターに一致するレコードがテーブルに見つかりません。

    応答本文のパラメーター (JSON)

    名前 説明
    ID 製品在庫 [sn_prd_invt_product_inventory] テーブルの製品在庫の sys_id。

    データタイプ:文字列

    name 製品在庫の名前。

    データタイプ:文字列

    place 製品に関連付けられた場所。

    データタイプ:文字列

    productCharacteristic 製品特性のリスト。

    データタイプ:アレイ

    "productCharacteristic": [
       {
          "name": "String",
          "value": "String"
       }
    ]
    productCharacteristic.name 特性の名前。

    データタイプ:文字列

    productCharacteristic.value 特性の値。

    データタイプ:文字列

    productOffering 製品在庫が関連付けられている製品オファリング。

    データタイプ:オブジェクト

    "productOffering": {
       "id": "String",
       "name": "String"
    }
    productOffering.id 製品オファリングの sys_id。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.name 製品オファリングの名前。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productRelationship 関連製品のリスト。

    データタイプ:アレイ

    "productRelationship": [
       {
          "productId": "String",
          "relationshipType": "String"
       }
    ]
    productRelationship.productId 製品在庫 [sn_prd_invt_product_inventory] テーブルの関連製品の sys_id。

    データタイプ:文字列

    productRelationship.relationshipType 関係のタイプ。

    データタイプ:文字列

    productSpecification 製品の製品仕様。

    データタイプ:オブジェクト

    "productSpecification": {
          "id": "String"
    }
    productSpecification.id 製品仕様の sys_id。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    realizingResource 実現のためのリソース。

    データタイプ:オブジェクト

    "realizingResource": {
          "id": "String",
          "type": "String"
    }
    realizingResource.id 製品在庫 [sn_prd_invt_product_inventory] テーブルの実現のためのリソースの sys_id。

    データタイプ:文字列

    realizingResource.type 実現のためのリソースのタイプ。

    データタイプ:文字列

    realizingService 実現のためのサービス。

    データタイプ:オブジェクト

    "realizingService": {
          "id": "String",
          "type": "String"
    }
    realizingService.id 製品在庫 [sn_prd_invt_product_inventory] テーブルの実現のためのサービスの sys_id。

    データタイプ:文字列

    realizingService.type 実現のためのサービスのタイプ。

    データタイプ:文字列

    relatedParty チケットに関連付けられている関係者のリスト。

    データタイプ:アレイ

    "relatedParty": [
       {
          "id": "String",
          "@referredType": "String"
       }
    ]
    relatedParty.id チケットに関連付けられているアカウントまたは顧客連絡先の sys_id。アカウント [customer_account]、連絡先 [customer_contact] またはコンシューマー [csm_consumer] テーブルにあります。

    データタイプ:文字列

    relatedParty.@referredType 顧客のタイプ。
    可能な値:
    • カスタマー
    • 顧客連絡先
    • consumer

    データタイプ:文字列

    state 製品の現在のステータス。

    データタイプ:文字列

    cURL 要求

    この例では、すべての製品在庫を取得します。

    curl "https://instance.servicenow.com/api/sn_prd_invt/productinventory" \
    --request GET \
    --user 'username':'password'
    
    
    

    応答本文。

    [
       {
          "id": "075072aec3a83010abc8b5183c40dd44",
          "relatedParty": [
             {
                "id": "ffc68911c35420105252716b7d40dd55",
                "name": "Funco Intl",
                "@type": "RelatedParty",
                "@referredType": "Customer"
             },
             {
                "id": "eaf68911c35420105252716b7d40ddde",
                "name": "Sally Thomas",
                "@type": "RelatedParty",
                "@referredType": "CustomerContact"
             }
          ],
          "name": "Firewall Administration PI0000300",
          "productSpecification": {
             "id": "31c5caff07266010a7955b7e0ad3006b",
             "name": "Firewall Administration"
          },
          "status": "Active",
          "productOffering": {
             "id": "",
             "name": ""
          },
          "place": {
             "id": "920cf6ac73d423002728660c4cf6a799",
             "name": "200 South James street,Atlanta, GA"
          },
          "productCharacteristic": [
             {
                "name": "Firewall Administration CPE Type",
                "valueType": "Choice",
                "value": "Physical"
             },
             {
                "name": "Configuration and Policy backup",
                "valueType": "Choice",
                "value": ""
             },
             {
                "name": "Firewall Administration CPE ID",
                "valueType": "Single Line Text",
                "value": "CPE123456789"
             },
             {
                "name": "Remote CLI troubleshoot support",
                "valueType": "Choice",
                "value": ""
             },
             {
                "name": "Firewall Administration CPE Model",
                "valueType": "Choice",
                "value": "9300 series"
             }
          ],
          "productRelationship": [],
          "realizingService": [],
          "realizingResource": [
             {
                "id": "3546463307666010a7955b7e0ad3005d",
                "name": "Cisco Firewall Management system"
             }
          ]
       },
       {
          "id": "0303a8ea74418510f877ca57242ff96d",
          "relatedParty": [
             {
                "id": "ffc68911c35420105252716b7d40dd55",
                "name": "Funco Intl",
                "@type": "RelatedParty",
                "@referredType": "Customer"
             },
             {
                "id": "eaf68911c35420105252716b7d40ddde",
                "name": "Sally Thomas",
                "@type": "RelatedParty",
                "@referredType": "CustomerContact"
             }
          ],
          "name": "SD-WAN Edge Device PI0001114",
          "productSpecification": {
             "id": "39b627aa53702010cd6dddeeff7b1202",
             "name": "SD-WAN Edge Device"
          },
          "status": "Installation Pending",
          "productOffering": {
             "id": "69017a0f536520103b6bddeeff7b127d",
             "name": "Premium SD-WAN Offering"
          },
          "place": "",
          "productCharacteristic": [],
          "productRelationship": [],
          "realizingService": [
             {
                "id": "bf65eadc1b7420106ba59acf034bcb57",
                "name": "SD-WAN Routing"
             },
             {
                "id": "16d79ec3532520103b6bddeeff7b12a6",
                "name": "SD WAN Optimization Service"
             },
             {
                "id": "16d79ec3532520103b6bddeeff7b12a6",
                "name": "SD WAN Optimization Service"
             },
             {
                "id": "bf65eadc1b7420106ba59acf034bcb57",
                "name": "SD-WAN Routing"
             },
             {
                "id": "bf65eadc1b7420106ba59acf034bcb57",
                "name": "SD-WAN Routing"
             },
             {
                "id": "bf65eadc1b7420106ba59acf034bcb57",
                "name": "SD-WAN Routing"
             }
          ],
          "realizingResource": [
             {
                "id": "493fa60b536520103b6bddeeff7b12b6",
                "name": "Customer Premise SD-WAN Router"
             }
          ]
       }
    ]

    製品在庫オープン API - GET /sn_prd_invt/productinventory/{inventoryId}

    製品在庫を取得します。

    重要:
    Tokyo リリース以降、このエンドポイントは廃止されました。このエンドポイントの新しいバージョンは 製品在庫オープン API - GET /sn_prd_invt/product/{id} です。

    URL 形式

    デフォルトの URL:/api/sn_prd_invt/productinventory/{inventoryId}

    サポートされている要求パラメーター

    表 : 19. パスパラメーター
    名前 説明
    inventoryId 取得する製品在庫の sys_id。製品在庫 [sn_prd_invt_product_inventory] テーブルにあります。

    データタイプ:文字列

    表 : 20. クエリパラメーター
    名前 説明
    customer 顧客別に製品在庫をフィルタリングします。顧客の sys_id または外部 id がこのパラメーターの値に一致する製品オファリングのみが応答で返されます。

    データタイプ:文字列

    fields 応答で返すフィールドのリスト。無効なフィールドは無視されます。このパラメーターを使用しない場合、すべてのフィールドが返されます。

    データタイプ:文字列

    place 場所別に製品在庫をフィルタリングします。場所の sys_id または外部 id がこのパラメーターの値に一致する製品オファリングのみが応答で返されます。

    データタイプ:文字列

    status ステータス別に製品在庫をフィルタリングします。ステータスがこのパラメーターの値に一致する製品在庫のみが応答で返されます。

    データタイプ:文字列

    表 : 21. 要求本文パラメーター (JSON)
    名前 説明
    なし

    ヘッダー

    次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 サポートされている REST API ヘッダー」を参照してください。

    表 : 22. 要求ヘッダー
    ヘッダー 説明
    なし
    表 : 23. 応答ヘッダー
    ヘッダー 説明
    Content-Type 応答本文のデータフォーマット。application/json のみをサポートします。

    ステータスコード

    この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 REST API HTTP 応答コード」を参照してください。

    表 : 24. ステータスコード
    ステータスコード 説明
    200 要求が正常に処理されました。
    400
    要求が正しくありません。以下のいずれかの理由が考えられます。
    • 無効なパスパラメーター
    • 無効な URI
    404 レコードが見つかりません。ID に関連付けられたレコードがテーブルに見つかりません。

    応答本文のパラメーター (JSON)

    名前 説明
    ID 製品在庫 [sn_prd_invt_product_inventory] テーブルの製品在庫の sys_id。

    データタイプ:文字列

    name 製品在庫の名前。

    データタイプ:文字列

    place 製品に関連付けられた場所。

    データタイプ:文字列

    productCharacteristic 製品特性のリスト。

    データタイプ:アレイ

    "productCharacteristic": [
       {
          "name": "String",
          "value": "String"
       }
    ]
    productCharacteristic.name 特性の名前。

    データタイプ:文字列

    productCharacteristic.value 特性の値。

    データタイプ:文字列

    productOffering 製品在庫が関連付けられている製品オファリング。

    データタイプ:オブジェクト

    "productOffering": {
       "id": "String",
       "name": "String"
    }
    productOffering.id 製品オファリングの sys_id。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.name 製品オファリングの名前。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productRelationship 関連製品のリスト。

    データタイプ:アレイ

    "productRelationship": [
       {
          "productId": "String",
          "relationshipType": "String"
       }
    ]
    productRelationship.productId 製品在庫 [sn_prd_invt_product_inventory] テーブルの関連製品の sys_id。

    データタイプ:文字列

    productRelationship.relationshipType 関係のタイプ。

    データタイプ:文字列

    productSpecification 製品の製品仕様。

    データタイプ:オブジェクト

    "productSpecification": {
          "id": "String"
    }
    productSpecification.id 製品仕様の sys_id。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    realizingResource 実現のためのリソース。

    データタイプ:オブジェクト

    "realizingResource": {
          "id": "String",
          "type": "String"
    }
    realizingResource.id 製品在庫 [sn_prd_invt_product_inventory] テーブルの実現のためのリソースの sys_id。

    データタイプ:文字列

    realizingResource.type 実現のためのリソースのタイプ。

    データタイプ:文字列

    realizingService 実現のためのサービス。

    データタイプ:オブジェクト

    "realizingService": {
          "id": "String",
          "type": "String"
    }
    realizingService.id 製品在庫 [sn_prd_invt_product_inventory] テーブルの実現のためのサービスの sys_id。

    データタイプ:文字列

    realizingService.type 実現のためのサービスのタイプ。

    データタイプ:文字列

    relatedParty チケットに関連付けられている関係者のリスト。

    データタイプ:アレイ

    "relatedParty": [
       {
          "id": "String",
          "@referredType": "String"
       }
    ]
    relatedParty.id チケットに関連付けられているアカウントまたは顧客連絡先の sys_id。アカウント [customer_account]、連絡先 [customer_contact]、またはコンシューマー [csm_consumer] テーブルにあります。

    データタイプ:文字列

    relatedParty.@referredType 顧客のタイプ。
    可能な値:
    • Customer
    • CustomerContact
    • コンシューマー

    データタイプ:文字列

    state 製品の現在のステータス。

    データタイプ:文字列

    cURL 要求

    この例では、SD-WAN サービスパッケージの製品在庫を取得します。

    curl --location --request GET 'https:// instance.servicenow.com/api/sn_prd_invt/productinventory/074450fc74918d10f877ca57242ff9e3' \
    --user 'username':'password'
    
    
    

    出力:

    {
       "id": "074450fc74918d10f877ca57242ff9e3",
       "relatedParty": [
          {
             "id": "ffc68911c35420105252716b7d40dd55",
             "name": "Funco Intl",
             "@type": "RelatedParty",
             "@referredType": "Customer"
          },
          {
             "id": "eaf68911c35420105252716b7d40ddde",
             "name": "Sally Thomas",
             "@type": "RelatedParty",
             "@referredType": "CustomerContact"
          }
       ],
       "name": "SD-WAN Service Package PI0001576",
       "productSpecification": {
          "id": "cfe5ef6a53702010cd6dddeeff7b12f6",
          "name": "SD-WAN Service Package"
       },
       "status": "Installation Pending",
       "productOffering": {
          "id": "69017a0f536520103b6bddeeff7b127d",
          "name": "Premium SD-WAN Offering"
       },
       "place": "",
       "productCharacteristic": [],
       "productRelationship": [
          {
             "id": "a74490fc74918d10f877ca57242ff942",
             "name": "SD-WAN Edge Device PI0001582",
             "relationshipType": "Bundles"
          },
          {
             "id": "b85414fc74918d10f877ca57242ff90e",
             "name": "SD-WAN Controller PI0001602",
             "relationshipType": "Bundles"
          },
          {
             "id": "d74490fc74918d10f877ca57242ff907",
             "name": "SD-WAN Security PI0001577",
             "relationshipType": "Bundles"
          }
       ],
       "realizingService": [],
       "realizingResource": []
    }

    製品在庫オープン API - POST /sn_prd_invt/product

    製品在庫レコードを作成します。

    URL 形式

    デフォルトの URL:/api/sn_prd_invt/product

    サポートされている要求パラメーター

    表 : 25. パスパラメーター
    名前 説明
    なし
    表 : 26. クエリパラメータ
    名前 説明
    なし
    表 : 27. 要求本文パラメーター (JSON)
    名前 説明
    name 必須です。製品在庫の名前。

    データタイプ:文字列

    pid 外部システムからの製品在庫の一意の識別子。

    データタイプ:文字列

    デフォルト:空白の文字列

    productCharacteristic 製品特性のリスト。

    データタイプ:アレイ

    "productCharacteristic": [
       {
          "name": "String",
          "value": "String"
       }
    ]
    productCharacteristic.name 特性の名前。

    データタイプ:文字列

    デフォルト:空白の文字列

    productCharacteristic.value 特性の値。

    データタイプ:文字列

    デフォルト:空白の文字列

    productOffering 必須です。製品在庫が関連付けられている製品オファリング。

    データタイプ:オブジェクト

    "productOffering": {
       "id": "String",
       "internalVersion": "String",
       "name": "String",
       "version": "String"
    }
    productOffering.id 必須です。製品オファリングの initial_version または external_id。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.internalVersion 製品オファリングのバージョン。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.name 製品オファリングの名前。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    デフォルト:空白の文字列

    productOffering.version 製品オファリングの external_version。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productRelationship 関連製品のリスト。

    データタイプ:アレイ

    "productRelationship": [
       {
          "productId": "String",
          "relationshipType": "String"
       }
    ]
    productRelationship.productId productRelationship パラメーターを使用する場合は必須です。製品在庫 [sn_prd_invt_product_inventory] テーブルの関連製品の sys_id。

    データタイプ:文字列

    productRelationship.relationshipType 関係のタイプ。有効な値は child のみです。

    データタイプ:文字列

    デフォルト:空白の文字列

    productSpecification 必須です。製品の製品仕様。

    データタイプ:オブジェクト

    "productSpecification": {
          "id": "String",
          "internalVersion": "String",
          "version": "String"
    }
    productSpecification.id 必須です。製品仕様の initial_version または external_id。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    productSpecification.internalVersion 製品仕様のバージョン。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    productSpecification.version 製品仕様の external_version。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    realizingResource 製品を実現するリソース。実現のためのリソースは、この製品在庫の子製品在庫です。

    データタイプ:オブジェクト

    "realizingResource": {
      "id": "String",
      "type": "String"
    }
    realizingResource.id realizingResource パラメーターを使用する場合は必須です。 実現のためのリソースの sys_id。製品在庫 [sn_prd_invt_product_inventory] テーブルにあります。

    データタイプ:文字列

    realizingResource.type 実現のためのリソースのタイプ。

    有効な値:child

    データタイプ:文字列

    realizingService 製品を実現するサービス。実現のためのサービスは、この製品在庫の子製品在庫です。

    データタイプ:オブジェクト

    "realizingService": {
      "id": "String",
      "type": "String"
    }
    realizingService.id realizingService パラメーターを使用する場合は必須です。 実現のためのサービスの sys_id。製品在庫 [sn_prd_invt_product_inventory] テーブルにあります。

    データタイプ:文字列

    realizingService.type 実現のためのサービスのタイプ。

    有効な値:child

    データタイプ:文字列

    relatedParty チケットに関連付けられている関係者のリスト。

    データタイプ:アレイ

    "relatedParty": [
      {
        "id": "String",
        "@referredType": "String"
      }
    ]
    relatedParty.id relatedParty パラメーターを使用する場合は必須です。チケットに関連付けられているアカウントまたは顧客連絡先の sys_id。アカウント [customer_account]、連絡先 [customer_contact]、またはコンシューマー [csm_consumer] テーブルにあります。

    データタイプ:文字列

    relatedParty.@referredType 顧客のタイプ。
    可能な値:
    • customer
    • customer_contact
    • consumer

    データタイプ:文字列

    デフォルト:空白の文字列

    state 製品の現在のステータス。
    可能な値:
    • active
    • change_pending
    • inactivation_pending
    • inactive
    • installation_pending

    データタイプ:文字列

    デフォルト:installation_pending

    ヘッダー

    次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 サポートされている REST API ヘッダー」を参照してください。

    表 : 28. 要求ヘッダー
    ヘッダー 説明
    承認 応答本文のデータフォーマット。application/json のみをサポートします。
    Content-Type 要求本文のデータ形式。application/json のみをサポートします。
    表 : 29. 応答ヘッダー
    ヘッダー 説明
    Content-Type 応答本文のデータフォーマット。application/json のみをサポートします。

    ステータスコード

    この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 REST API HTTP 応答コード」を参照してください。

    表 : 30. ステータスコード
    ステータスコード 説明
    201 要求が正常に処理されました。
    400 要求が正しくありません。以下のいずれかの理由が考えられます。
    • 空のペイロード。
    • 無効なペイロード必須フィールドがありません:<フィールド名>

    応答本文のパラメーター (JSON)

    名前 説明
    href 製品在庫レコードへの相対リンク。

    データタイプ:文字列

    ID 製品在庫 [sn_prd_invt_product_inventory] テーブルの製品在庫の sys_id。

    データタイプ:文字列

    name 製品在庫の名前。

    データタイプ:文字列

    pid 外部システムからの製品在庫の一意の識別子。

    データタイプ:文字列

    productCharacteristic 製品特性のリスト。

    データタイプ:アレイ

    "productCharacteristic": [
       {
          "name": "String",
          "value": "String"
       }
    ]
    productCharacteristic.name 特性の名前。

    データタイプ:文字列

    productCharacteristic.value 特性の値。

    データタイプ:文字列

    productOffering 製品在庫が関連付けられている製品オファリング。

    データタイプ:オブジェクト

    "productOffering": {
       "id": "String",
       "internalId": "String",
       "internalVersion": "String",
       "name": "String",
       "version": "String"
    }
    productOffering.id 製品オファリングの initial_version または external_id。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.internalId 製品オファリングの initial_version。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.internalVersion 製品オファリングのバージョン。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.name 製品オファリングの名前。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.version 製品オファリングの external_version。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productPrice 空のアレイを返します。

    データタイプ:アレイ

    productRelationship 関連製品のリスト。

    データタイプ:アレイ

    "productRelationship": [
      {
        "productId": "String",
        "relationshipType": "String"
      }
    ]
    productRelationship.productId 製品在庫 [sn_prd_invt_product_inventory] テーブルの関連製品の sys_id。

    データタイプ:文字列

    productRelationship.relationshipType 関係のタイプ。

    データタイプ:文字列

    productSpecification 製品の製品仕様。

    データタイプ:オブジェクト

    "productSpecification": {
      "id": "String",
      "internalId": "String",
      "internalVersion": "String",
      "version": "String"
    }
    productSpecification.id 製品仕様の initial_version または external_id。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    productSpecification.internalId 製品仕様の initial_version。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    productSpecification.internalVersion 製品仕様のバージョン。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    productSpecification.version 製品仕様の external_version。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    realizingResource 製品を実現するリソース。実現のためのリソースは、この製品在庫の子製品在庫です。

    データタイプ:オブジェクト

    "realizingResource": {
      "id": "String",
      "type": "String"
    }
    realizingResource.id 実現のためのリソースの sys_id。製品在庫 [sn_prd_invt_product_inventory] テーブルにあります。

    データタイプ:文字列

    realizingResource.type 実現のためのリソースのタイプ。

    有効な値:child

    データタイプ:文字列

    realizingService 製品を実現するサービス。実現のためのサービスは、この製品在庫の子製品在庫です。

    データタイプ:オブジェクト

    "realizingService": {
      "id": "String",
      "type": "String"
    }
    realizingService.id 実現のためのサービスの sys_id。製品在庫 [sn_prd_invt_product_inventory] テーブルにあります。

    データタイプ:文字列

    realizingService.type 実現のためのサービスのタイプ。

    有効な値:child

    データタイプ:文字列

    relatedParty チケットに関連付けられている関係者のリスト。

    データタイプ:アレイ

    "relatedParty": [
      {
         "id": "String",
         "@referredType": "String"
      }
    ]
    relatedParty.id チケットに関連付けられているアカウントまたは顧客連絡先の sys_id。アカウント [customer_account]、連絡先 [customer_contact]、またはコンシューマー [csm_consumer] テーブルにあります。

    データタイプ:文字列

    relatedParty.@referredType 顧客のタイプ。
    可能な値:
    • Customer
    • CustomerContact
    • コンシューマー

    データタイプ:文字列

    state 製品の現在のステータス。

    データタイプ:文字列

    cURL 要求

    この例では、ユーザーのボイスオーバー IP ソリューションの製品在庫を作成します。

    curl -X POST "https://instance.service-now.com/api/sn_prd_invt/product" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --user "username":"password" \
    --data "[
       {
          "pid": "PO-456",
          "description": "inventory description",
          "isBundle": false,
          "name": "Voice Over IP Basic instance for Jean",
          "productOffering": {
             "@referredType": "ProductOffering",
             "name": "Premium SD-WAN Offering",
             "id": "69017a0f536520103b6bddeeff7b127d"
          },
          "productCharacteristic": [],
          "productRelationship": [
             {
                "productId": "fa6d13f45b5620102dff5e92dc81c77f",
                "relationshipType": "child"
             }
          ],
          "realizingService": {
             "id": "fe6d13f45b5620102dff5e92dc81c786",
             "relationshipType": "child"
          },
          "realizingResource": {
             "id": "326d13f45b5620102dff5e92dc81c78c",
             "relationshipType": "child"
          },
          "relatedParty": [
             {
                "@referredType": "CustomerContact",
                "@type": "RelatedParty",
                "name": "Sally Thomas",
                "id": "eaf68911c35420105252716b7d40ddde"
             },
             {
                "@referredType": "Customer",
                "@type": "RelatedParty",
                "name": "Funco Intl",
                "id": "ffc68911c35420105252716b7d40dd55"
             }
          ],
          "productSpecification": {
             "@referredType": "ProductSpecification",
             "@type": null,
             "name": null,
             "id": "3ee1fdb1c3331010d216b5183c40dd81",
             "internalVersion": "1"
          },
          "bundle": false
       }
    ]"

    応答本文。

    {
       "pid": "PO-456",
       "description": "inventory description",
       "isBundle": false,
       "name": "Voice Over IP Basic instance for Jean",
       "productOffering": {
          "@referredType": "ProductOffering",
          "name": "Premium SD-WAN Offering",
          "id": "69017a0f536520103b6bddeeff7b127d",
          "internalVersion": "1",
          "version": null,
          "status": "published",
          "internalId": "69017a0f536520103b6bddeeff7b127d"
       },
       "productCharacteristic": [],
       "productRelationship": [
          {
             "productId": "fa6d13f45b5620102dff5e92dc81c77f",
             "relationshipType": "child"
          }
       ],
       "realizingService": {
          "id": "fe6d13f45b5620102dff5e92dc81c786",
          "relationshipType": "child"
       },
       "realizingResource": {
          "id": "326d13f45b5620102dff5e92dc81c78c",
          "relationshipType": "child"
       },
       "relatedParty": [
          {
             "@referredType": "CustomerContact",
             "@type": "RelatedParty",
             "name": "Sally Thomas",
             "id": "eaf68911c35420105252716b7d40ddde"
          },
          {
             "@referredType": "Customer",
             "@type": "RelatedParty",
             "name": "Example Company",
             "id": "ffc68911c35420105252716b7d40dd55"
          }
       ],
       "productSpecification": {
          "@referredType": "ProductSpecification",
          "@type": null,
          "name": null,
          "id": "3ee1fdb1c3331010d216b5183c40dd81",
          "internalVersion": "1",
          "version": null,
          "status": "published",
          "internalId": "3ee1fdb1c3331010d216b5183c40dd81"
       },
       "bundle": false,
       "productPrice": [],
       "id": "25b07475471789108761b955d36d439d",
       "href": "/api/sn_prd_invt/product/25b07475471789108761b955d36d439d"
    }

    製品在庫オープン API - POST /sn_prd_invt/productinventory

    製品在庫を作成します。

    重要:
    Tokyo リリース以降、このエンドポイントは廃止されました。このエンドポイントの新しいバージョンは 製品在庫オープン API - POST /sn_prd_invt/product です。

    URL 形式

    デフォルトの URL:/api/sn_prd_invt/productinventory

    サポートされている要求パラメーター

    表 : 31. パスパラメーター
    名前 説明
    なし
    表 : 32. クエリパラメータ
    名前 説明
    なし
    表 : 33. 要求本文パラメーター (JSON)
    名前 説明
    name 必須です。製品在庫の名前。

    データタイプ:文字列

    pid 外部システムからの製品在庫の一意の識別子。

    データタイプ:文字列

    デフォルト:空白の文字列

    productCharacteristic 製品特性のリスト。

    データタイプ:アレイ

    "productCharacteristic": [
       {
          "name": "String",
          "value": "String"
       }
    ]
    productCharacteristic.name 特性の名前。

    データタイプ:文字列

    デフォルト:空白の文字列

    productCharacteristic.value 特性の値。

    データタイプ:文字列

    デフォルト:空白の文字列

    productOffering 必須です。製品在庫が関連付けられている製品オファリング。

    データタイプ:オブジェクト

    "productOffering": {
       "id": "String",
       "name": "String"
    }
    productOffering.id 必須です。製品オファリングの sys_id。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.name 製品オファリングの名前。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    デフォルト:空白の文字列

    productRelationship 関連製品のリスト。

    データタイプ:アレイ

    "productRelationship": [
       {
          "productId": "String",
          "relationshipType": "String"
       }
    ]
    productRelationship.productId productRelationship パラメーターを使用する場合は必須です。製品在庫 [sn_prd_invt_product_inventory] テーブルの関連製品の sys_id。

    データタイプ:文字列

    productRelationship.relationshipType 関係のタイプ。有効な値は child のみです。

    データタイプ:文字列

    デフォルト:空白の文字列

    productSpecification 必須です。製品の製品仕様。

    データタイプ:オブジェクト

    "productSpecification": {
          "id": "String"
    }
    productSpecification.id 必須です。製品仕様の sys_id。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    realizingResource 実現のためのリソース。

    データタイプ:オブジェクト

    "realizingResource": {
          "id": "String",
          "type": "String"
    }
    realizingResource.id realizingResource パラメーターを使用する場合は必須です。製品在庫 [sn_prd_invt_product_inventory] テーブルの実現のためのリソースの sys_id。

    データタイプ:文字列

    realizingResource.type 実現のためのリソースのタイプ。有効な値は child のみです。

    データタイプ:文字列

    デフォルト:空白の文字列

    realizingService 実現のためのサービス。

    データタイプ:オブジェクト

    "realizingService": {
          "id": "String",
          "type": "String"
    }
    realizingService.id realizingService パラメーターを使用する場合は必須です。製品在庫 [sn_prd_invt_product_inventory] テーブルの実現のためのサービスの sys_id。

    データタイプ:文字列

    realizingService.type 実現のためのサービスのタイプ。有効な値は child のみです。

    データタイプ:文字列

    デフォルト:空白の文字列

    relatedParty チケットに関連付けられている関係者のリスト。

    データタイプ:アレイ

    "relatedParty": [
       {
          "id": "String",
          "@referredType": "String"
       }
    ]
    relatedParty.id relatedParty パラメーターを使用する場合は必須です。チケットに関連付けられているアカウントまたは顧客連絡先の sys_id。アカウント [customer_account]、連絡先 [customer_contact]、またはコンシューマー [csm_Consumer] テーブルにあります。

    データタイプ:文字列

    relatedParty.@referredType 顧客のタイプ。
    可能な値:
    • customer
    • customer_contact
    • consumer

    データタイプ:文字列

    デフォルト:空白の文字列

    state 製品の現在のステータス。
    可能な値:
    • active
    • change_pending
    • inactivation_pending
    • inactive
    • installation_pending

    データタイプ:文字列

    デフォルト:installation_pending

    ヘッダー

    次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 サポートされている REST API ヘッダー」を参照してください。

    表 : 34. 要求ヘッダー
    ヘッダー 説明
    承認 応答本文のデータフォーマット。application/json のみをサポートします。
    Content-Type 要求本文のデータ形式。application/json のみをサポートします。
    表 : 35. 応答ヘッダー
    ヘッダー 説明
    Content-Type 応答本文のデータフォーマット。application/json のみをサポートします。

    ステータスコード

    この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 REST API HTTP 応答コード」を参照してください。

    表 : 36. ステータスコード
    ステータスコード 説明
    201 要求が正常に処理されました。
    400 要求が正しくありません。以下のいずれかの理由が考えられます。
    • 空のペイロード。
    • 無効なペイロード必須フィールドがありません:<フィールド名>

    応答本文のパラメーター (JSON)

    名前 説明
    ID 製品在庫 [sn_prd_invt_product_inventory] テーブルの製品在庫の sys_id。

    データタイプ:文字列

    name 製品在庫の名前。

    データタイプ:文字列

    pid 外部システムからの製品在庫の一意の識別子。

    データタイプ:文字列

    productCharacteristic 製品特性のリスト。

    データタイプ:アレイ

    "productCharacteristic": [
       {
          "name": "String",
          "value": "String"
       }
    ]
    productCharacteristic.name 特性の名前。

    データタイプ:文字列

    productCharacteristic.value 特性の値。

    データタイプ:文字列

    productOffering 製品在庫が関連付けられている製品オファリング。

    データタイプ:オブジェクト

    "productOffering": {
       "id": "String",
       "name": "String"
    }
    productOffering.id 製品オファリングの sys_id。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productOffering.name 製品オファリングの名前。製品オファリング [sn_prd_pm_product_offering] テーブルにあります。

    データタイプ:文字列

    productRelationship 関連製品のリスト。

    データタイプ:アレイ

    "productRelationship": [
       {
          "productId": "String",
          "relationshipType": "String"
       }
    ]
    productRelationship.productId 製品在庫 [sn_prd_invt_product_inventory] テーブルの関連製品の sys_id。

    データタイプ:文字列

    productRelationship.relationshipType 関係のタイプ。

    データタイプ:文字列

    productSpecification 製品の製品仕様。

    データタイプ:オブジェクト

    "productSpecification": {
          "id": "String"
    }
    productSpecification.id 製品仕様の sys_id。製品仕様 [sn_prd_pm_product_specification] テーブルにあります。

    データタイプ:文字列

    realizingResource 実現のためのリソース。

    データタイプ:オブジェクト

    "realizingResource": {
          "id": "String",
          "type": "String"
    }
    realizingResource.id 製品在庫 [sn_prd_invt_product_inventory] テーブルの実現のためのリソースの sys_id。

    データタイプ:文字列

    realizingResource.type 実現のためのリソースのタイプ。

    データタイプ:文字列

    realizingService 実現のためのサービス。

    データタイプ:オブジェクト

    "realizingService": {
          "id": "String",
          "type": "String"
    }
    realizingService.id 製品在庫 [sn_prd_invt_product_inventory] テーブルの実現のためのサービスの sys_id。

    データタイプ:文字列

    realizingService.type 実現のためのサービスのタイプ。

    データタイプ:文字列

    relatedParty チケットに関連付けられている関係者のリスト。

    データタイプ:アレイ

    "relatedParty": [
       {
          "id": "String",
          "@referredType": "String"
       }
    ]
    relatedParty.id チケットに関連付けられているアカウントまたは顧客連絡先の sys_id。アカウント [customer_account]、連絡先 [customer_contact]、またはコンシューマー [csm_consumer] テーブルにあります。

    データタイプ:文字列

    relatedParty.@referredType 顧客のタイプ。
    可能な値:
    • Customer
    • CustomerContact
    • コンシューマー

    データタイプ:文字列

    state 製品の現在のステータス。

    データタイプ:文字列

    cURL 要求

    この例では、ユーザーのボイスオーバー IP ソリューションの製品在庫を作成します。

    curl --location --request POST “https://instance.servicenow.com/api/sn_prd_invt/productinventory” \
    --header “Content-Type: application/json” \
    --data-raw '[
        {
            "pid": "demoInventory",
            "description": "inventory description",
            "isBundle": false,
            "name": "Voice Over IP Basic instance for Jean",
            "productOffering": {
                "id": "69017a0f536520103b6bddeeff7b127d",
                "name": "Premium SD-WAN Offering",
                "@referredType": "ProductOffering"
            },
            "productCharacteristic": [
                {
                    "name": "CPE Type",
                    "valueType": "choice",
                    "value": "Virtual"
                },
                {
                    "name":"Routing",
                    "valueType": "choice",
                    "value": "Premium"
                }
            ],
            "productRelationship": [
                {
                    "productId": "7e6d13f45b5620102dff5e92dc81c787",
                    "relationshipType": "child"
                }
            ],
            "relatedParty": [
                {
                    "id": "eaf68911c35420105252716b7d40ddde",
                    "name": "Sally Thomas",
                    "role": "User",
                    "@type": "RelatedParty",
                    "@referredType": "CustomerContact"
                },
                {
                    "id": "ffc68911c35420105252716b7d40dd55",
                    "name": "Funco Intl",
                    "@type": "RelatedParty",
                    "@referredType": "Customer"
                }
            ],
            "productSpecification": {
                "id": "cfe5ef6a53702010cd6dddeeff7b12f6",
                "@referredType": "ProductSpecification",
                "version": "1"
            }
        }
    ]'
    --user 'username':'password'
    

    応答本文。

    {
       "pid": "demoInventory",
       "description": "inventory description",
       "isBundle": false,
       "name": "Voice Over IP Basic instance for Jean",
       "productOffering": {
          "id": "69017a0f536520103b6bddeeff7b127d",
          "name": "Premium SD-WAN Offering",
          "@referredType": "ProductOffering"
       },
       "productCharacteristic": [
          {
             "name": "CPE Type",
             "valueType": "choice",
             "value": "Virtual"
          },
          {
             "name": "Routing",
             "valueType": "choice",
             "value": "Premium"
          }
       ],
       "productRelationship": [
          {
             "productId": "7e6d13f45b5620102dff5e92dc81c787",
             "relationshipType": "child"
          }
       ],
       "relatedParty": [
          {
             "id": "eaf68911c35420105252716b7d40ddde",
             "name": "Sally Thomas",
             "role": "User",
             "@type": "RelatedParty",
             "@referredType": "CustomerContact"
          },
          {
             "id": "ffc68911c35420105252716b7d40dd55",
             "name": "Funco Intl",
             "@type": "RelatedParty",
             "@referredType": "Customer"
          }
       ],
       "productSpecification": {
          "id": "cfe5ef6a53702010cd6dddeeff7b12f6",
          "@referredType": "ProductSpecification",
          "version": "1"
       },
       "id": "3ac715c6745d8150f877ca57242ff97a"
    }