ServiceNow® API を使用すると、カスタムアプリケーションとエクスペリエンスをビルドできます。Yokohama リリースでは API の拡張と更新が行われています。
Yokohama リリースでの API の特長
- スクリプトでサーバー側の JavaScript API を使用して、アプリケーションの機能を変更します。
- フォームのロード時、フォームの送信時、フィールド値の変更時など、クライアントベースのイベントが発生するたびにクライアント API を実行します。
- インバウンド REST API を使用して、アプリケーション内のさまざまな ServiceNow 機能とやり取りします。
詳細については、「API implementation and reference」を参照してください。
Yokohama リリースの新機能
表 : 1. Yokohama での新しいスコープ対象クラスと既存のスコープ対象クラスへの追加メソッド
| クラス |
メソッド |
| Console - Scoped, Global |
- error()
- group()
- groupCollapsedString()
- groupEnd()
- info()
- log()
- table()
- time()
- timeEnd()
- timeLog()
- trace()
- warn()
|
| Fetch - Scoped, Global |
fetch() |
| Fetch Headers - Scoped, Global |
- Headers()
- append()
- delete()
- entries()
- forEach()
- get()
- getSetCookie()
- has()
- keys()
- set()
- values()
|
| Fetch Request - Scoped, Global |
- Request()
- arrayBuffer()
- blob()
- bytes()
- clone()
- formData()
- json()
- text()
|
| Fetch RequestInit - Scoped, Global |
requestInit() |
| Fetch Response - Scoped,Global |
- arrayBuffer()
- blob()
- bytes()
- formData()
- json()
- text()
|
| GlideUser - Scoped |
- getTimeZoneLabel()
- getTimeZoneLabelLang()
|
| OrderUtil - Scoped |
- getStateFromOrder()
- isOrderInDraftState()
|
| PDFGenerationAPI - Scoped, Global |
- convertToPDFAsync()
- convertToPDFWithHeaderFooterAsync()
|
| ProcessMiningIntegrationAPI - Scoped |
- createProject()
- deleteProject()
- getBreakDownStats()
- getFindings()
- getMiningStatus()
- getProject()
- scheduleMining()
|
| RESTMessageV2 - Scoped, Global |
setAllowedRedirectURIs() |
| SOAPMessageV2 - Scoped, Global |
- setAllowedRedirectURIs()
- setFollowRedirect()
|
| UriMatcher - Scoped |
|
| UriMatcherResponse - Scoped |
- getErrorMessages()
- isError()
- isFragmentMatches()
- isHostMatches()
- isMatch()
- isPathMatches()
- isSchemeMatches()
|
| v_record - Scoped, Global |
setLastErrorMessage() |
表 : 3. Yokohama における新しい REST API と既存の REST API への追加のエンドポイント
| API |
エンドポイント |
| AWA Offer Work API |
POST /now/awa/documents/{document_table}/{document_sys_id}/offer |
| Continuous Integration and Continuous Delivery (CICD) Update Set API |
- POST /sn_cicd/update_set/retrieve
- POST /sn_cicd/update_set/commitMultiple
- POST /sn_cicd/update_set/preview/{remote_update_set_id}
- POST /sn_cicd/update_set/back_out
- POST /sn_cicd/update_set/commit/{remote_update_set_id}
- POST /sn_cicd/update_set/create
|
表 : 6. ServiceNow Store における新しい REST API と既存の REST API への追加のエンドポイント
| アプリケーション |
アプリケーションバージョン |
API |
エンドポイント |
| 買掛金オペレーション |
v2.0.0 |
AP Invoice API |
- POST /sn_spend_intg/ap_invoice/xml
|
| 拡張製品モデルおよび資産クラス |
v1.0 |
AI Assets API |
- GET /sn_ent/asset/ai_dataset/{sys_id}
- GET /sn_ent/asset/ai_model/{sys_id}
- GET /sn_ent/asset/ai_prompt/{sys_id}
- GET /sn_ent/asset/ai_system/{sys_id}
- POST /sn_ent/asset/ai_dataset
- POST sn_ent/asset/ai_model
- POST /sn_ent/asset/ai_prompt
- POST /sn_ent/asset/ai_system
- PUT /sn_ent/asset/ai_dataset/{sys_id}
- PUT /sn_ent/asset/ai_model/{sys_id}
- PUT /sn_ent/asset/ai_prompt/{sys_id}
- PUT /sn_ent/asset/ai_system/{sys_id}
|
| カスタマー契約とエンタイトルメント |
v6.0 |
Service Contract API |
- POST /sn_pss_core/servicecontract
- GET /sn_pss_core/servicecontract/{id}
- POST /sn_pss_core/servicecontract/contractline
- GET /sn_pss_core/servicecontract/contractline/{id}
|
| カスタマー契約とエンタイトルメント |
v6.0 |
Verify Entitlements API |
GET /sn_ent_verify/verifyentitlements |
| リード管理 |
v3.0 |
lead API |
- GET /sn_lead_mgmt_core/lead
- GET /sn_lead_mgmt_core/lead/{sys_id}
- PATCH /sn_lead_mgmt_core/lead/{sys_id}
- POST /sn_lead_mgmt_core/lead
|
| セールスと注文管理 |
v4.0 |
Sales Agreement API |
- GET /sn_sales_agmt_core/salesagreement /{id}
- POST /sn_sales_agmt_core/salesagreement
|
このリリースでの変更
表 : 7. Yokohama で変更されたスコープ対象クラス
| クラス |
メソッド |
| PDFGenerationAPI - Scoped, Global |
- convertToPDF()
- convertToPDFWithHeaderFooter()
指定された外部 URL を PDF 出力にレンダリングするかどうかを確定するために、新しいプロパティ glide.pdf.url.whitelisting.enabled と com.snc.pdf.whitelisted_urls が追加されました。
PDF アクセシビリティに対応するために、新しいプロパティ accessibilityEnabled が追加されました。
|
表 : 8. Yokohama で変更されたグローバルクラス
| クラス |
メソッド |
| PDFGenerationAPI - Scoped, Global |
- convertToPDF()
- convertToPDFWithHeaderFooter()
指定された外部 URL を PDF 出力にレンダリングするかどうかを確定するために、新しいプロパティ glide.pdf.url.whitelisting.enabled と com.snc.pdf.whitelisted_urls が追加されました。
PDF アクセシビリティに対応するために、新しいプロパティ accessibilityEnabled が追加されました。
|
表 : 9. Yokohama で変更された REST API
| API |
エンドポイント |
| Attachment API |
POST /now/attachment/file:Now Mobile アプリ がオフラインであり、後で添付ファイルがレコードにアップロードされたときに、新しいパラメーター creation_time を使用して添付ファイルの作成時間をキャプチャできます。 |
表 : 12. ServiceNow Store における変更された REST API
| アプリケーション |
アプリケーションバージョン |
API |
エンドポイント |
| 買掛金オペレーション |
v2.0.0 |
AP Invoice API |
請求先住所情報をサポートするプロパティを追加します。
- POST /sn_spend_intg/ap_invoice/cxml
- POST /sn_spend_intg/ap_invoice/json
|
| ATF テストジェネレーターとクラウドランナー |
2.7.2 |
Cloud Runner Test Generation - POST /now/sn_atf_tg/test_generation |
テスト生成中に作成される新しいテストスイートの名前を設定できる testSuite パラメーターが追加されました。 |
| 注文管理 |
v11.3.0 |
Product Order Open API |
productSpecification要求パラメーターが必須からオプションに変更されました。
- パッチ /sn_ind_tmt_orm/order/productOrder/{id}
- パッチ /sn_ind_tmt_orm/productorder/{id}
- POST /sn_ind_tmt_orm/order/productOrder
- POST /sn_ind_tmt_orm/productorder
|
| 注文管理
|
v12.5.0 |
Product Inventory Open API |
productSpecification要求パラメーターが必須からオプションに変更されました。これらのエンドポイントは、すべてのプロダクトインベントリレコードを取得するようになりました。以前のリリースでは、指定された製品仕様のない製品インベントリレコードは返されませんでした。
- POST /api/sn_prd_invt_/product
- GET /api/sn_prd_invt_/product
- GET /api/sn_prd_invt_/product/{id}
|
| 製品カタログ |
v14.1.0 |
Product Catalog Open API |
製品バンドルを指定する機能が次のエンドポイントに追加されました。
- GET /sn_tmf_api/ catalogmanagement/catalog
- GET /sn_tmf_api/ catalogmanagement/catalog/{id}
- GET /sn_tmf_api/ catalogmanagement/productOffering
- GET /sn_tmf_api/ catalogmanagement/productOffering/{id}
- パッチ /sn_tmf_api/ catalogmanagement/productOffering/{id}
- POST /sn_tmf_api/ catalogmanagement/productOffering
- GET /sn_tmf_api/ catalogmanagement/productSpecification
- GET/sn_tmf_api/ catalogmanagement/productSpecification/{id}
- PATCH /sn_tmf_api/ catalogmanagement/productSpecification/{id}
- POST /sn_tmf_api/ catalogmanagement/productSpecification
|
アクティベーション情報
デフォルトでは、次の API が利用可能です。
- Attachment
- Console
- Fetch
- Fetch.Headers
- Fetch.Request
- Fetch.Response
- Fetch.RequestInit
- GlideDynamicAttribute
- GlideDynamicAttributeStore
- GlideElementDynamicAttributeStore
- GlideTransientDynamicAttribute
- GlideUser
- openFrameAPI
- PDFGenerationAPI
- RESTMessageV2
- ScriptableUriMatcher
- SOAPMessageV2
- UriMatcher
- UriMatcherResponse
次の API にはプラグインのアクティブ化が必要です。
- AI 資産 API を使用するには、資産クラス (sn_ent) プラグインをアクティブ化する必要があります。
- AP 請求書 API を使用するには、買掛金請求書処理 (com.sn_ap_apm) プラグインをアクティブ化する必要があります。
- AWA オファーワーク API を使用するには、高度な作業アサイン (com.glide.awa) プラグインをアクティブ化する必要があります。
- IBQConfigBase API を使用するには、Sales and Service API Core (com.sn_tmt_core) プラグインをアクティブ化する必要があります。
- リード API を使用するには、リード管理データモデル (sn_lead_mgmt_core) プラグインをアクティブ化する必要があります。
- Mobile SDK を使用するには、Mobile SDK Android ライブラリ (NowSDK) または Mobile SDK iOS ライブラリをダウンロードしてインストールする必要があります。
- OpenFrame API を使用するには、com.sn_openframe_store プラグインをアクティブ化する必要があります。
- OrderUtil API (スクリプトインクルード) を使用するには、注文管理 (com.sn_ind_tmt_orm) プラグインをアクティブ化する必要があります。
- ProcessMiningIntegrationAPI を使用するには、プロセスマイニングコア (com.sn_process_optimization) プラグインをアクティブ化する必要があります。
- Product Order Open API および Product Inventory Open API を使用するには、注文管理 (sn_ind_tmt_orm) プラグインを有効にする必要があります。
- 販売契約 API では、次のプラグインをアクティブ化する必要があります。
- 販売契約データモデル (com.sn_sales_agmt_core)
- 製品カタログ管理コア (com.sn_prd_pm)
- 価格設定 (com.sn_csm_pricing)
- サービス契約 API を使用するには、次のプラグインをアクティブ化する必要があります。
- カスタマー契約とエンタイトルメント (com.sn_pss_core)
- カスタマーサービスインストールベース管理 (com.snc.install)
- 製品カタログ管理コア (com.sn_prd)
- v_record API を使用するには、リモートテーブル (com.glide.script.vtable) プラグインをアクティブ化する必要があります。
- エンタイトルメントの検証 API を使用するには、エンタイトルメントの検証 (com.sn_ent_verify) プラグインをアクティブ化する必要があります。