> You are reading the Docusign Developer Documentation. For clean Markdown of any page, append .md to the page URL.
>
> Documentation indexes by section:
> - APIs and SDKs: https://docusign.docs.buildwithfern.com/docs/llms.txt
> - Platform 101: https://docusign.docs.buildwithfern.com/platform/llms.txt
> - Extension Apps: https://docusign.docs.buildwithfern.com/extension-apps/llms.txt
> - Docusign CLI: https://docusign.docs.buildwithfern.com/docusign-cli/llms.txt
>
> Authentication (OAuth, JWT Grant, M2M): https://docusign.docs.buildwithfern.com/platform/auth
> Webhooks and Connect: https://docusign.docs.buildwithfern.com/platform/webhooks
>
> OpenAPI specifications: https://docusign.docs.buildwithfern.com/openapi.json
> MCP server: https://docusign.docs.buildwithfern.com/_mcp/server

# How to make a direct API call

> This topic demonstrates how you can make a direct API call to the eSignature REST API from the Docusign Android SDK module if there is no existing SDK method.

This topic demonstrates how you can make a [direct API call](/docs/mobile-sdks/android-sdk/android101/core-interfaces#call-the-esignature-rest-api-directly) to the [eSignature REST API](/docs/esign-rest-api) from the Docusign [Android SDK](/docs/mobile-sdks/android-sdk) module if there is no existing SDK method; in this case, to retrieve a user’s signature ID.

## Required data

Running the code in this how-to requires this data:

| Data element               | Description                                                                                                                                                                                                                                                                              |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \{API_ACCOUNT_ID}          | A [GUID](http://guid.one/) value that identifies your account. This value is automatically generated by Docusign for any account you create. Copy the value from the **API Account ID** field on the [Apps and Keys](https://admindemo.docusign.com/authenticate?goTo=appsAndKeys) page. |
| \{IMPERSONATION_USER_GUID} | A [GUID](http://guid.one/) value that identifies the user. This value is automatically generated by Docusign. Copy the value from the **User ID** field on the [Apps and Keys](https://admindemo.docusign.com/authenticate?goTo=appsAndKeys) page.                                       |

## Step 1. Log in to Docusign

To make the API calls shown in this how-to, you must be logged in to Docusign.

See [How to log in to Docusign from your app](/docs/mobile-sdks/android-sdk/how-to/log-in) for details.

## Step 2. Construct your API headers

Use the [getESignAPIDelegate](https://docusign.github.io/mobile-android-sdk/sdk/com.docusign.androidsdk/-docu-sign/get-e-sign-api-delegate.html?query=fun%20getESignApiDelegate\(\):%20DSESignApiDelegate) method to retrieve the API account ID and user ID needed to get the user signature ID.

**`Java`**

```java title="Java"
DSESignApiDelegate eSignApiDelegate = DocuSign.getInstance().getESignApiDelegate();
final UsersApi usersApi = eSignApiDelegate.createApiService(UsersApi.class);
if (usersApi != null) {
       DSAuthenticationDelegate authDelegate = DocuSign.getInstance().getAuthenticationDelegate();
        final DSUser user = authDelegate.getLoggedInUser(getApplicationContext());

```

**`Kotlin`**

```kotlin title="Kotlin"
val eSignApiDelegate = DocuSign.getInstance().getESignApiDelegate()
val usersApi = eSignApiDelegate.createApiService(UsersApi::class.java)

val authDelegate = DocuSign.getInstance().getAuthenticationDelegate()
val user = authDelegate.getLoggedInUser(applicationContext)

```

## Step 3. Call the eSignature REST API to get the user signature ID

Next, use the account information you retrieved in step 2 to make the direct API call via the `userSignaturesGetUserSignatures` method.

**`Java`**

```java title="Java"
eSignApiDelegate.invoke(new DSESignApiListener() {

  @Override
   public <T> void onSuccess(T response) {
         if (response instanceof UserSignaturesInformation) {
             UserSignature userSignature = ((UserSignaturesInformation) response).getUserSignatures().get(0);
             Log.d("makeDirectApiCall", "Signature Id: " + userSignature.getSignatureId());
         }
    }


}, () -> usersApi.userSignaturesGetUserSignatures(user.getAccountId(), user.getUserId(), "signature"));
```

**`Kotlin`**

```kotlin title="Kotlin"
eSignApiDelegate.invoke(object : DSESignApiListener {
    override fun <T> onSuccess(response: T?) {
       if (response is UserSignaturesInformation) {
              val userSignature = (response as UserSignaturesInformation).userSignatures[0]
               Log.d("makeDirectApiCall", "Signature Id: " + userSignature.signatureId)
       }
    }
    override fun onError(exception: DSRestException) {
       Log.e("makeDirectApiCall", exception.localizedMessage)
     }
}) { usersApi!!.userSignaturesGetUserSignatures(user.accountId, user.userId, "signature") }
```

## Expected response

You should receive your user’s signature ID.

```text
Signature Id: 7faf2365-xxxx-xxxx-xxxx-1cbd9e6dff30
```

## Next steps

* See [How to request a signature online (embedded signing)](/docs/mobile-sdks/android-sdk/how-to/request-signature-embedded).
* Learn [How to create an envelope for offline signing (PDF)](/docs/mobile-sdks/android-sdk/how-to/offline-signing-pdf).
* See [How to start the signing process for an unsigned envelope without connectivity (offline)](/docs/mobile-sdks/android-sdk/how-to/start-signing-offline).