---
sourceDocument: Xanadu API リファレンス
sourceDocumentLink: https://www.servicenow.com/docs/r/ja-JP/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - ja-JP

ft:publication_title :

    - Xanadu API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowDataSDK クラス: Android

# NowDataSDK クラス: Android {#ariaid-title1}

* リリースバージョン: Xanadu
* 
* 更新日 2024年08月01日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：7分

NowDataSDK クラスは、NowGraphQLService、NowAttachmentService、NowTableService、NowAPIService などのさまざまな機能サービスの作成と初期化を可能にする関数を提供します。

## NowDataSDK - makeGraphQLService(instanceURL: URL) {#ariaid-title2}

NowGraphQLService 機能のインスタンスを作成して初期化します。このサービスにより、ServiceNow インスタンスの GraphQL API にアクセスできます。
ServiceNow GraphQL API の詳細については、「[GraphQL API フレームワークを使用したレコードデータのクエリ](https://www.servicenow.com/docs/6WTXO0Z_d8_ld2Kr~1xX9Q "コンポーネントまたはサードパーティシステムからレコードデータをクエリするカスタム GraphQL API を作成します。")」を参照してください。
{#NDataSDK-makeGraphQLService_S_O_O__table_nvx_zbt_4pb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| インスタンス URL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | アクセスする ServiceNow インスタンスの URL。例 `:「https://instance.servicenow.com」` |
[表 : 1. パラメーター]

{#NDataSDK-makeGraphQLService_S_O_O__table_nvx_zbt_4pb} {#NDataSDK-makeGraphQLService_S_O_O__table_ovx_zbt_4pb__entry__2}

| タイプ | Description (説明) |
|-|-|
| 結果\<NowGraphQLService\> | [Kotlin Result オブジェクト](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/)にラップされた NowGraphQLService オブジェクト。 |
[表 : 2. 返される内容]

{#NDataSDK-makeGraphQLService_S_O_O__table_ovx_zbt_4pb}  
次のコード例は、この関数を呼び出す方法を示しています。

    private var nowGraphQLService: NowGraphQLService? = null

    /**
      * Create the NowGraphQLService once in the lifetime of the application, inside the Application class
      * or another manager class that will be injected into other classes via dagger/hilt.
      * NowGraphQLService should be created after initializing the NowSDK.
      */
    suspend fun getNowGraphQLService(): NowGraphQLService? {
      if (nowGraphQLService != null) return nowGraphQLService

      return NowDataSDK.makeGraphQLService(URL("https://instance-name.service-now.com")).getOrThrow()
        .also { this.nowGraphQLService = it }
    }

## NowDataSDK - makeNowAPIService(instanceURL: URL) {#ariaid-title3}

NowAPIService サービスのインスタンスを作成して初期化します。このサービスを使用すると、 ServiceNow インスタンスによって公開されたパブリック REST API にアクセスできます。
さらに、カスタムスクリプト済み REST API を ServiceNow インスタンス内で開発し、[NowAPIService](https://www.servicenow.com/docs/w6sch~omcl72vV8rTCYH3w#NowAPIServiceAndroidInterface "NowAPIService インターフェイスは、指定された ServiceNow REST API で要求を実行する機能を提供します。") API を使用して Android アプリケーション内でそれらの API にアクセスすることもできます。ServiceNow REST API の詳細については、「[Scripted REST APIs](https://www.servicenow.com/docs/rqlU4~W6X4mtyFzdx98uoA "Scripted REST API 機能を使用すると、アプリケーション開発者はカスタム Web サービス API を構築できます。")」を参照してください。
{#NDataSDK-makeNowAPIService_S_O_O__table_rjf_lft_4pb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| インスタンス URL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | アクセスする ServiceNow インスタンスの URL。例 `:「https://instance.servicenow.com」` |
[表 : 3. パラメーター]

{#NDataSDK-makeNowAPIService_S_O_O__table_rjf_lft_4pb} {#NDataSDK-makeNowAPIService_S_O_O__table_sjf_lft_4pb__entry__2}

| タイプ | Description (説明) |
|-|-|
| 結果\<NowAPIService\> | [Kotlin Result オブジェクト](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/)にラップされた NowAPIService。 |
[表 : 4. 返される内容]

{#NDataSDK-makeNowAPIService_S_O_O__table_sjf_lft_4pb}  
次のコード例は、この関数を呼び出す方法を示しています。

    private var nowApiService: NowAPIService? = null

    /**
      * Create the NowAPIService once in the lifetime of the application inside the Application class
      * or another manager class that will be injected into other classes via dagger/hilt.
      * NowAPIService should be created after initializing the NowSDK
      */
    suspend fun getNowApiService(): NowAPIService? {
      if (nowApiService != null) return nowApiService

      return NowDataSDK.makeAPIService(URL("https://instance-name.service-now.com")).getOrThrow()
        .also { this.nowApiService = it }
    }

## NowDataSDK - makeNowAttachmentService(instanceURL: URL) {#ariaid-title4}

NowAttachmentService 機能のインスタンスを作成して初期化します。
このサービスを使用すると、 ServiceNow インスタンスから添付ファイルをアップロード、ダウンロード、および削除できます。添付ファイルをインスタンスにアップロードすると、 Android アプリケーションにダウンロードできる添付ファイルのメタデータが生成されます。

ServiceNow添付ファイルの詳細については、「[添付ファイル API](https://www.servicenow.com/docs/wBetsecnSLzsO1otMGyceA#c_AttachmentAPI "添付ファイル API は、添付ファイルのアップロードおよびクエリを可能にするエンドポイントを提供します。")」を参照してください。
{#NDataSDK-makeNowAttachService_S_O_O__table_bnd_qgt_4pb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| インスタンス URL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | アクセスする ServiceNow インスタンスの URL。例 `:「https://instance.servicenow.com」` |
[表 : 5. パラメーター]

{#NDataSDK-makeNowAttachService_S_O_O__table_bnd_qgt_4pb} {#NDataSDK-makeNowAttachService_S_O_O__table_cnd_qgt_4pb__entry__2}

| タイプ | Description (説明) |
|-|-|
| 結果\<NowAttachmentService\> | [Kotlin Result オブジェクト](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/)にラップされた NowAttachmentService オブジェクト。 |
[表 : 6. 返される内容]

{#NDataSDK-makeNowAttachService_S_O_O__table_cnd_qgt_4pb}  
次のコード例は、このメソッドを呼び出す方法を示しています。

    private var nowAttachmentService: NowAttachmentService? = null

    /**
      * Create the NowAttachmentService once in the lifetime of the application inside the Application
      * class or another manager class that will be injected into other classes via dagger/hilt.
      * NowAttachmentService should be created after initializing the NowSDK.
      */
    suspend fun getNowAttachmentService(): NowAttachmentService? {
      if (nowAttachmentService != null) return nowAttachmentService

      return NowDataSDK.makeAttachmentService(URL("https://instance-name.service-now.com"))
        .getOrThrow()
        .also { this.nowAttachmentService = it }
    }

## NowDataSDK - makeTableService(instanceURL: URL) {#ariaid-title5}

NowTableService 機能のインスタンスを作成して初期化します。
このサービスを使用すると、ServiceNowインスタンス上の REST テーブル API にアクセスできます。REST テーブル API の詳細については、「 [テーブル API](https://www.servicenow.com/docs/ZG4exohIDD0edcrV7VpdmA#c_TableAPI "テーブル API は、既存のテーブルでの作成、読み取り、更新、および削除 (CRUD) 操作の実行を可能にするエンドポイントを提供します。")」を参照してください。
{#NDataSDK-makeTableService_S_O_O__table_jxh_vht_4pb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| インスタンス URL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | アクセスする ServiceNow インスタンスの URL。例 `:「https://instance.servicenow.com」` |
[表 : 7. パラメーター]

{#NDataSDK-makeTableService_S_O_O__table_jxh_vht_4pb} {#NDataSDK-makeTableService_S_O_O__table_kxh_vht_4pb__entry__2}

| タイプ | Description (説明) |
|-|-|
| 結果\<NowTableService\> | [Kotlin Result オブジェクト](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/)にラップされた NowTableService オブジェクト。 |
[表 : 8. 返される内容]

{#NDataSDK-makeTableService_S_O_O__table_kxh_vht_4pb}  
次のコード例は、この関数を呼び出す方法を示しています。

    private var nowTableService: NowTableService? = null

    /**
      * Create the NowTableService once in the lifetime of the application inside the Application
      * class or another manager class that will be injected into other classes via dagger/hilt.
      * NowTableService should be created after initializing the NowSDK.
      */
    suspend fun getNowTableService(): NowTableService? {
      if (nowTableService != null) return nowTableService

      return NowDataSDK.makeTableService(URL("https://instance-name.service-now.com")).getOrThrow()
        .also { this.nowTableService = it }
    }


