---
sourceDocument: Référence API Brésil
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/fr-FR/api-reference

 Release :

    - brazil

ft:locale :

    - fr-FR

ft:publication_title :

    - Référence API Brésil

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Classe NowDataSDK : Android

# Classe NowDataSDK : Android {#ariaid-title1}

Rversion finale: Brazil  
Mis à jour 10 sept. 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes de lecture  
La classe NowDataSDK fournit des fonctions qui permettent la création et l'initialisation de divers services de fonctionnalités tels que NowGraphQLService, NowAttachmentService, NowTableService et NowAPIService.

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

Crée et initialise une instance de la fonctionnalité NowGraphQLService. Ce service permet d'accéder à l'API GraphQL sur votre ServiceNow instance.
Pour plus d'informations sur l'API ServiceNow GraphQL, reportez-vous à la section [Interroger les données d'enregistrement à l'aide du cadre de travail API GraphQL](https://servicenow-prod.fluidtopics.net/7Hqy6X3VdMofePsoYrG7uA "Créez une API GraphQL personnalisée pour interroger les données d’enregistrement d’un composant ou d’un système tiers.").
{#NDataSDK-makeGraphQLService_S_O_O__table_nvx_zbt_4pb__entry__3}

| Nom | Type | Description |
|-|-|-|
| URL d'instance | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL de l'instance ServiceNow à laquelle accéder. Par exemple, `<< https://instance.servicenow.com >>` |
[Tableau 1. Paramètres]

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

| Type | Description |
|-|-|
| Résultat\<NowGraphQLService\> | Objet NowGraphQLService enveloppé dans un [objet Kotlin Result](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Tableau 2. Renvoie]

{#NDataSDK-makeGraphQLService_S_O_O__table_ovx_zbt_4pb}  
L'exemple de code suivant montre comment appeler cette fonction.

    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}

Crée et initialise une instance du service NowAPIService. Ce service vous permet d'accéder aux API REST publiques exposées par votre ServiceNow instance.
En outre, vous pouvez développer des API REST scriptées personnalisées au sein de votre ServiceNow instance et y accéder au sein de votre Android application à l'aide de l'API [NowAPIService](https://servicenow-prod.fluidtopics.net/ffGiC4yqDTfBnjpfxAPoSQ#NowAPIServiceAndroidInterface "L’interface NowAPIService permet d’effectuer des demandes sur une API REST spécifiée ServiceNow .") . Pour plus d'informations sur ServiceNow les API REST, reportez-vous à la section [API REST basées sur un script](https://servicenow-prod.fluidtopics.net/yHzfL9xl5TWaRn~hBzzXYQ "La fonctionnalité d’API REST scriptée permet aux développeurs d’applications de créer des API de service Web personnalisées.").
{#NDataSDK-makeNowAPIService_S_O_O__table_rjf_lft_4pb__entry__3}

| Nom | Type | Description |
|-|-|-|
| URL d'instance | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL de l'instance ServiceNow à laquelle accéder. Par exemple, `<< https://instance.servicenow.com >>` |
[Tableau 3. Paramètres]

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

| Type | Description |
|-|-|
| Résultat\<NowAPIService\> | NowAPIService enveloppé dans un [objet Kotlin Result](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Tableau 4. Renvoie]

{#NDataSDK-makeNowAPIService_S_O_O__table_sjf_lft_4pb}  
L'exemple de code suivant montre comment appeler cette fonction.

    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}

Crée et initialise une instance de la fonctionnalité NowAttachmentService.
Ce service vous permet de charger, télécharger et supprimer des fichiers en pièce jointe de votre ServiceNow instance. Une fois que vous avez chargé une pièce jointe dans votre instance, celle-ci génère des métadonnées pour la pièce jointe que vous pouvez ensuite télécharger dans votre Android application.

Pour plus d'informations sur ServiceNow les pièces jointes, reportez-vous à la section [API de pièce jointe](https://servicenow-prod.fluidtopics.net/9FaVrwzdv3T9fTmlJxKHAQ#c_AttachmentAPI "L’API de pièce jointe fournit des points de terminaison qui vous permettent de charger et d’interroger les pièces jointes de fichiers.").
{#NDataSDK-makeNowAttachService_S_O_O__table_bnd_qgt_4pb__entry__3}

| Nom | Type | Description |
|-|-|-|
| URL d'instance | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL de l'instance ServiceNow à laquelle accéder. Par exemple, `<< https://instance.servicenow.com >>` |
[Tableau 5. Paramètres]

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

| Type | Description |
|-|-|
| Résultat \<NowAttachmentService\> | Objet NowAttachmentService enveloppé dans un [objet de résultat Kotlin](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Tableau 6. Renvoie]

{#NDataSDK-makeNowAttachService_S_O_O__table_cnd_qgt_4pb}  
L'exemple de code suivant montre comment appeler cette méthode.

    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}

Crée et initialise une instance de la fonctionnalité NowTableService.
Ce service vous permet d'accéder à l'API de table REST sur une ServiceNow instance. Pour plus d'informations sur l'API de table REST, consultez [API de table](https://servicenow-prod.fluidtopics.net/hvc1GsLbAl1WsMeIpPid0A#c_TableAPI "L’API de table fournit des points de terminaison qui vous permettent d’effectuer les opérations créer, lire, mettre à jour et supprimer (CRUD) sur des tables existantes.").
{#NDataSDK-makeTableService_S_O_O__table_jxh_vht_4pb__entry__3}

| Nom | Type | Description |
|-|-|-|
| URL d'instance | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL de l'instance ServiceNow à laquelle accéder. Par exemple, `<< https://instance.servicenow.com >>` |
[Tableau 7. Paramètres]

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

| Type | Description |
|-|-|
| Résultat\<NowTableService\> | Objet NowTableService enveloppé dans un [objet de résultat Kotlin](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Tableau 8. Renvoie]

{#NDataSDK-makeTableService_S_O_O__table_kxh_vht_4pb}  
L'exemple de code suivant montre comment appeler cette fonction.

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


