Call interface - Android
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.
| Name | Type | Description |
|---|---|---|
| request | Request | Original request that initiated this call. |
Parent Topic:Mobile SDK - Android
Call - cancel()
Cancels the associated call, if possible (best effort.)
| Name | Type | Description |
|---|---|---|
| None |
| Type | Description |
|---|---|
| None |
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>)
Schedules the request to be executed as soon as the system\thread is available to execute this request.
|
Name |
Type |
Description |
|---|---|---|
|
onSuccess |
Consumer<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 |
|
onError |
Consumer<NowDataError> |
Callback to execute if the call fails.NowDataError |
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()
Invokes the request immediately. Blocks until the response is processed or is in error.
| Name | Type | Description |
|---|---|---|
| None |
| Type | Description |
|---|---|
| Response<T> | Response data in the format defined in the T parameter. |
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()---
title: Call interface - Android
description: The Call interface represents a request that is prepared for processing.Cancels the associated call, if possible \(best effort.\)Schedules the request to be executed as soon as the system\\thread is available to execute this request.Invokes the request immediately. Blocks until the response is processed or is in error.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/api-reference/cllent-mobile-api-reference/CallAndroidInterface.html
release: brazil
product: Cllent Mobile API Reference
classification: cllent-mobile-api-reference
topic_type: concept
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Mobile SDK - Android, Mobile SDK API reference, API reference, API implementation and reference]
---
# Call interface- Android
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.
|Name|Type|Description|
|----|----|-----------|
|request|Request|Original request that initiated this call.|
**Parent Topic:**[Mobile SDK - Android](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/api-reference/cllent-mobile-api-reference/MobileSDKAndroidAPI.md)
## Call - cancel\(\)
Cancels the associated call, if possible \(best effort.\)
|Name|Type|Description|
|----|----|-----------|
|None| | |
|Type|Description|
|----|-----------|
|None| |
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>\)
Schedules the request to be executed as soon as the system\\thread is available to execute this request.
<table id="table_tnq_3nt_4pb" class="parameters"><thead><tr><th>
Name
</th><th>
Type
</th><th>
Description
</th></tr></thead><tbody><tr><td>
onSuccess
</td><td>
[Consumer](https://developer.android.com/reference/kotlin/java/util/function/Consumer.html)<Response<T>>
</td><td>
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.
</td></tr><tr><td>
onError
</td><td>
[Consumer](https://developer.android.com/reference/kotlin/java/util/function/Consumer.html)<NowDataError>
</td><td>
Callback to execute if the call fails.NowDataError
</td></tr></tbody>
</table>|Type|Description|
|----|-----------|
|None| |
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\(\)
Invokes the request immediately. Blocks until the response is processed or is in error.
|Name|Type|Description|
|----|----|-----------|
|None| | |
|Type|Description|
|----|-----------|
|Response<T>|Response data in the format defined in the **T** parameter.|
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()
```
| title | Call interface - Android |
| description | The Call interface represents a request that is prepared for processing.Cancels the associated call, if possible \(best effort.\)Schedules the request to be executed as soon as the system\\thread is available to execute this request.Invokes the request immediately. Blocks until the response is processed or is in error. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/api-reference/cllent-mobile-api-reference/CallAndroidInterface.html |
| release | brazil |
| product | Cllent Mobile API Reference |
| classification | cllent-mobile-api-reference |
| topic_type | concept |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Mobile SDK - AndroidMobile SDK API referenceAPI referenceAPI implementation and reference |