---
sourceDocument: Referência da API de Yokohama
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/yokohama/api-reference

 Release :

    - yokohama

ft:locale :

    - pt-BR

ft:publication_title :

    - Referência da API de Yokohama

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowDataSDK classe - Android

# NowDataSDK classe - Android {#ariaid-title1}

* Versão de lançamento: Yokohama
* 
* Atualizado 30 de jan. de 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 min. de leitura

. NowDataSDK A classe fornece funções que permitem a criação e inicialização de vários serviços de recursos, como NowGraphQLService, NowAttachmentService, NowTableService e NowAPIService.

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

Cria e inicializa uma instância do recurso NowGraphQLService. Este serviço permite o acesso ao GraphQL API em seu ServiceNowinstância.
Para obter informações adicionais sobre ServiceNowGraphQL API, consulte [Consulte dados de registro usando a estrutura da API GraphQL](https://servicenow-prod.fluidtopics.net/cKO6HNxKPqz56P_i7CZ9fQ "Crie uma API GraphQL personalizada para consultar dados de registro de um componente ou de um sistema de terceiros.").
{#NDataSDK-makeGraphQLService_S_O_O__table_nvx_zbt_4pb__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| InstanceURL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL do ServiceNowinstância a ser acessada. Por exemplo, `"https://instance.servicenow.com" ` |
[Tabela 1. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| \<NowGraphQLService\> | Objeto NowGraphQLService encapsulado em A. [Objeto de resultado de Kotlin](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Tabela 2. Retornos]

{#NDataSDK-makeGraphQLService_S_O_O__table_ovx_zbt_4pb}  
O exemplo de código a seguir mostra como chamar esta função.

    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}

Cria e inicializa uma instância do serviço NowAPIService. Este serviço permite que você acesse as APIs REST públicas expostas pelo ServiceNowinstância.
Além disso, você pode desenvolver APIs REST com script personalizadas em seu ServiceNowe acesse-as em seu Androidaplicação que usa o. [NowAPIService](https://servicenow-prod.fluidtopics.net/uToHO0sX0QIQfoAn1Su9pg#NowAPIServiceAndroidInterface ". NowAPIService a interface fornece a capacidade de executar solicitações em um especificado ServiceNowREST API.")API. Para obter informações adicionais sobre ServiceNowREST APIs, consulte [Scripted REST APIs](https://servicenow-prod.fluidtopics.net/5I9MLtEwM~Ru~4Oc~9gbLg "O recurso REST API com script permite que os desenvolvedores de aplicações criem APIs de serviço web personalizadas.").
{#NDataSDK-makeNowAPIService_S_O_O__table_rjf_lft_4pb__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| InstanceURL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL do ServiceNowinstância a ser acessada. Por exemplo, `"https://instance.servicenow.com" ` |
[Tabela 3. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| \<NowAPIService\> | NowAPIService envolto em A. [Objeto de resultado de Kotlin](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Tabela 4. Retornos]

{#NDataSDK-makeNowAPIService_S_O_O__table_sjf_lft_4pb}  
O exemplo de código a seguir mostra como chamar esta função.

    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}

Cria e inicializa uma instância do recurso NowAttachmentService.
Este serviço permite carregar, baixar e excluir arquivos de anexo do ServiceNowinstância. Depois de carregar um anexo para sua instância, ele gera metadados para o anexo que você pode baixar em seu Androidaplicação.

Para obter informações adicionais sobre ServiceNowanexos, consulte [API de anexo](https://servicenow-prod.fluidtopics.net/3fcCmn5ZbJzxD5FNIXZxug#c_AttachmentAPI ". Anexo A API fornece endpoints que permitem carregar e consultar anexos de arquivo.").
{#NDataSDK-makeNowAttachService_S_O_O__table_bnd_qgt_4pb__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| InstanceURL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL do ServiceNowinstância a ser acessada. Por exemplo, `"https://instance.servicenow.com" ` |
[Tabela 5. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| \<NowAttachmentService\> | Objeto NowAttachmentService encapsulado em A. [Objeto de resultado de Kotlin](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Tabela 6. Retornos]

{#NDataSDK-makeNowAttachService_S_O_O__table_cnd_qgt_4pb}  
O exemplo de código a seguir mostra como chamar este método.

    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}

Cria e inicializa uma instância do recurso NowTableService.
Este serviço permite que você acesse O RESTANTE Tabela API em um ServiceNowinstância. Para obter informações adicionais sobre o RESTANTE Tabela API, consulte [API de tabela](https://servicenow-prod.fluidtopics.net/lNMR1BzoRgoNrEnaYm7cxQ#c_TableAPI ". Tabela A API fornece endpoints que permitem executar operações de criação, leitura, atualização e exclusão (CRUD) em tabelas existentes.").
{#NDataSDK-makeTableService_S_O_O__table_jxh_vht_4pb__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| InstanceURL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL do ServiceNowinstância a ser acessada. Por exemplo, `"https://instance.servicenow.com" ` |
[Tabela 7. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| \<NowTableService\> | Objeto NowTableService encapsulado em A. [Objeto de resultado de Kotlin](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Tabela 8. Retornos]

{#NDataSDK-makeTableService_S_O_O__table_kxh_vht_4pb}  
O exemplo de código a seguir mostra como chamar esta função.

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


