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


---

# Call interface - Android

# Call interface - Android {#ariaid-title1}

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

The Call interface represents a request that is prepared for
processing.
Possible processing options include:

* cancel
* enqueue
* execute
* map

A call object cannot be processed twice.
{#CallAndroidInterface__table_vx2_klw_5pb__entry__3}

| Name | Type | Description |
|-|-|-|
| request | Request | Original request that initiated this call. |
[Table 1. Properties]

{#CallAndroidInterface__table_vx2_klw_5pb}

## Call - cancel() {#ariaid-title2}

Cancels the associated call, if possible (best effort.)
{#Call-cancel__table_nsv_smt_4pb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 2. Parameters]

{#Call-cancel__table_nsv_smt_4pb} {#Call-cancel__table_osv_smt_4pb__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 3. Returns]

{#Call-cancel__table_osv_smt_4pb}  
The following code example shows how to call this function.

    private var inFlightDataRequestCall: Call<*>? = null 
    fun cancelTransfer() = inFlightDataRequestCall?.cancel() 

## Call - enqueue(onSuccess: Consumer\<Response\<T\>\>, onError:
Consumer\<NowDataError\>) {#ariaid-title3}

Schedules the request to be executed as soon as the system\\thread is available to
execute this request.
{#Call-enqueue_O_O__table_tnq_3nt_4pb__entry__3}

| Name | Type | Description |
|-|-|-|
| onSuccess | [Consumer](https://developer.android.com/reference/kotlin/java/util/function/Consumer.html)​\<Response\<T\>\> | Callback to execute if the call is successful. HTTP response with the body parsed to the data type specified by the T parameter. Note: Consumer is a OOB Java type for asynchronous consumption of an object. In this case, the call uses generic to return a type `Response<T>` where `T` is the object type. |
| onError | [Consumer](https://developer.android.com/reference/kotlin/java/util/function/Consumer.html)​\<NowDataError\> | Callback to execute if the call fails. NowDataError |
[Table 4. Parameters]

{#Call-enqueue_O_O__table_tnq_3nt_4pb} {#Call-enqueue_O_O__table_unq_3nt_4pb__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 5. Returns]

{#Call-enqueue_O_O__table_unq_3nt_4pb}  
The following code example shows how to call this function.

    fun makeGraphQLRequest(query: String) { 
      val call = graphQLService.graphQLRequest(query) 
      call.enqueue( 
        { response -> handleResponse(response) }, 
        { nowDataError -> handleError(nowDataError) } 
      ) 
    } 

## Call - execute() {#ariaid-title4}

Invokes the request immediately. Blocks until the response is processed or is in
error.
{#Call-execute__table_jcm_bqt_4pb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 6. Parameters]

{#Call-execute__table_jcm_bqt_4pb} {#Call-execute__table_kcm_bqt_4pb__entry__2}

| Type | Description |
|-|-|
| Response\<T\> | Response data in the format defined in the T parameter. |
[Table 7. Returns]

{#Call-execute__table_kcm_bqt_4pb}  
The following code example shows how to call this function.

    val response = apiService.data(NowAPIService.Endpoint( 
      relativePath = CASES_API, 
      requestMethod = HttpMethod.GET, 
      requireAuth = true) 
    ).execute()


