---
sourceDocument: 호주 API 참조
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ko-KR/api-reference

 Release :

    - australia

ft:locale :

    - ko-KR

ft:publication_title :

    - 호주 API 참조

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# 인스턴스에서 공용 REST API ServiceNow 와 상호작용

# 인스턴스에서 공용 REST API ServiceNow 와 상호작용 {#ariaid-title1}

* 릴리스 버전: Australia
* 
* 업데이트 날짜 2026년 03월 12일
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 소요 시간: 3분

애플리케이션이 Mobile SDK 인스턴스에서 ServiceNow 공용 REST API를 호출할 수 있는 Android 기능을 제공합니다.
[NowAPIService](https://servicenow-prod.fluidtopics.net/PhZa0CiIDXPnFNxVX8kaGw#NowAPIServiceAndroidInterface "NowAPIService 인터페이스는 지정된 ServiceNow REST API에서 요청을 수행하는 기능을 제공합니다.") API를 사용하면 기본 ServiceNow 공용 [REST API](https://servicenow-prod.fluidtopics.net/BmfxHtam_bWCH6UfXNXMIA "REST 인터페이스를 사용하여 인스턴스의 데이터에 액세스합니다.")와 상호 작용하거나 인스턴스 내에서 사용자 지정 REST API를 만들고 애플리케이션에서 Android 호출할 수 있습니다.

REST API를 ServiceNow 호출하기 전에[makeNowAPIService()](https://servicenow-prod.fluidtopics.net/eqi62BxntxJXKnDQkqnv2A#NDataSDK-makeNowAPIService_S_O_O "NowAPIService 서비스의 인스턴스를 작성하고 초기화합니다. 이 서비스를 사용하면 인스턴스에 ServiceNow 의해 노출되는 공용 REST API에 액세스할 수 있습니다.") 메서드를 호출하여 서비스의 인스턴스를 만들어야 합니다. 서비스 인스턴스는 콜백에 반환되고, 성공하면 오류가 발생합니다.  
다음은 NowAPIService 개체를 초기화하는 방법을 보여줍니다.

    /**
     * Helper class used to handle different Now service instances. It has an application scope or is Singleton
     */
    @Singleton
    class SdkManager @Inject constructor() {

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

    }

NowAPIService 객체가 초기화되면 NowAPIService [data()](https://servicenow-prod.fluidtopics.net/PhZa0CiIDXPnFNxVX8kaGw#NAPIServ-data_S_S_S_S "지정된 ServiceNow 인스턴스에서 지정된 REST API를 호출합니다.") 메서드를 사용하여 호출할 REST 엔드포인트와 관련된 모든 매개변수를 지정합니다.

     suspend fun makeNowApiCall() {
      val apiService = sdkManager.getNowApiService()

      val apiPath = "api/now/table/sn_customerservice_case"
      val endpoint = NowAPIService.Endpoint(HttpMethod.GET, apiPath, true)
      val fieldNames = "sys_id,number,short_description,number,priority,state," +
        "opened_at,account.name,account.number,contact.name,contact.email," +
        "contact_type,assignment_group.name,assigned_to.name"

      val queryParamsMap = mapOf("sysparm_fields" to fieldNames, "sysparm_limit" to "10")

      val queryParams = QueryParams.Builder().addAll(queryParamsMap).build()

      val response = runCatching {
        apiService?.data(endpoint = endpoint, queryParams = queryParams)?.execute()
      }

      if (response.isSuccess) {
        val resultString = response.getOrNull()?.body?.let { String(it) }
      } else {
        // Handle error
      }
    }


