---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowDataSDK class - Android

# NowDataSDK class - Android {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read

The NowDataSDK class provides functions that enable the creation and
initialization of various features services such as NowGraphQLService, NowAttachmentService,
NowTableService, and NowAPIService.

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

Creates and initializes an instance of the NowGraphQLService feature. This service enables access to the GraphQL API on your ServiceNow instance.
For additional information on the ServiceNow GraphQL API, see [Query record data using the GraphQL API framework](https://servicenow-prod.fluidtopics.net/2Q1cirFC~oyqNuLWkaEpyQ "Create a custom GraphQL API to query record data from a component or a third-party system.").
{#NDataSDK-makeGraphQLService_S_O_O__table_nvx_zbt_4pb__entry__3}

| Name | Type | Description |
|-|-|-|
| instanceURL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL of the ServiceNow instance to access. For example, `"https://instance.servicenow.com"` |
[Table 1. Parameters]

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

| Type | Description |
|-|-|
| Result\<NowGraphQLService\> | NowGraphQLService object wrapped in a [Kotlin Result object](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Table 2. Returns]

{#NDataSDK-makeGraphQLService_S_O_O__table_ovx_zbt_4pb}  
The following code example shows how to call this function.

    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}

Creates and initializes an instance of the NowAPIService service. This service allows you to access the public REST APIs exposed by your ServiceNow instance.
In addition, you can develop custom scripted REST APIs within your ServiceNow instance and access them within your Android application using the [NowAPIService](https://servicenow-prod.fluidtopics.net/Ruy5EdQ~h~QM1b7RygbeiA#NowAPIServiceAndroidInterface "The NowAPIService interface provides the ability to perform requests on a specified ServiceNow REST API.") API. For additional information on ServiceNow REST APIs, see [Scripted REST APIs](https://servicenow-prod.fluidtopics.net/x1EOw4mDLxo1z7QG_tlNhQ "The scripted REST API feature allows application developers to build custom web service APIs.").
{#NDataSDK-makeNowAPIService_S_O_O__table_rjf_lft_4pb__entry__3}

| Name | Type | Description |
|-|-|-|
| instanceURL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL of the ServiceNow instance to access. For example, `"https://instance.servicenow.com"` |
[Table 3. Parameters]

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

| Type | Description |
|-|-|
| Result\<NowAPIService\> | NowAPIService wrapped in a [Kotlin Result object](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Table 4. Returns]

{#NDataSDK-makeNowAPIService_S_O_O__table_sjf_lft_4pb}  
The following code example shows how to call this function.

    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}

Creates and initializes an instance of the NowAttachmentService feature.
This service enables you to upload, download, and delete attachment files from your ServiceNow instance. After you upload an attachment to your instance, it generates metadata for the attachment that you can then download into your Android application.

For additional information on ServiceNow attachments, see [Attachment API](https://servicenow-prod.fluidtopics.net/6cG37dgmR1vwJCbI7a6lCg#c_AttachmentAPI "The Attachment API provides endpoints that allow you to upload and query file attachments.").
{#NDataSDK-makeNowAttachService_S_O_O__table_bnd_qgt_4pb__entry__3}

| Name | Type | Description |
|-|-|-|
| instanceURL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL of the ServiceNow instance to access. For example, `"https://instance.servicenow.com"` |
[Table 5. Parameters]

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

| Type | Description |
|-|-|
| Result\<NowAttachmentService\> | NowAttachmentService object wrapped in a [Kotlin Result object](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Table 6. Returns]

{#NDataSDK-makeNowAttachService_S_O_O__table_cnd_qgt_4pb}  
The following code example shows how to call this method.

    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}

Creates and initializes an instance of the NowTableService feature.
This service enables you to access to the REST Table API on a ServiceNow instance. For additional information on the REST Table API, see [Table API](https://servicenow-prod.fluidtopics.net/1Gay5St9NtFuJYW7wnnCrg#c_TableAPI "The Table API provides endpoints that allow you to perform create, read, update, and delete (CRUD) operations on existing tables.").
{#NDataSDK-makeTableService_S_O_O__table_jxh_vht_4pb__entry__3}

| Name | Type | Description |
|-|-|-|
| instanceURL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL of the ServiceNow instance to access. For example, `"https://instance.servicenow.com"` |
[Table 7. Parameters]

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

| Type | Description |
|-|-|
| Result\<NowTableService\> | NowTableService object wrapped in a [Kotlin Result object](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Table 8. Returns]

{#NDataSDK-makeTableService_S_O_O__table_kxh_vht_4pb}  
The following code example shows how to call this function.

    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 }
    }


