---
title: "Creating a Signing Session"
slug: "creating-a-signing-session"
updated: 2024-10-10T09:31:59Z
published: 2024-10-10T09:31:59Z
canonical: "docs.onespan.com/creating-a-signing-session"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onespan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating a Signing Session

[Java SDK](/v1/docs/creating-a-signing-session#java-sdk) [.NET SDK](/v1/docs/creating-a-signing-session#net-sdk) [REST API](/v1/docs/creating-a-signing-session#rest-api) [APEX SDK](/v1/docs/creating-a-signing-session#apex-sdk)

## Java SDK

To download the full code sample see our [Code Share](https://community.onespan.com/documentation/onespan-sign/codeshare/get-signing-url-java-sdk/) site.

After a transaction has been sent, you can create a Signer Experience for your signers. This can be done in one of the following ways:

- By creating a session token and then building URL redirect,
- By retrieving the signing URL.
- The difference between building the URL with a session token and retrieving a signing url is that a signing URL does not expire.

### Creating a Signer Experience

To create a Signer Experience, you must first create the PackageId object of your document package.

If you need a comparison to the basic object creation procedure, or if this is the first time creating a transaction, see [](https://developer.esignlive.com/guides/quick-start/creating-and-sending-a-package-net/)[Creating and Sending a Transaction](/v1/docs/creating-and-sending-a-transaction#net-sdk).

To create a Signer Experience it is important to note that the status of your transaction must be either SENT or COMPLETE. Otherwise, an exception will be thrown.

Once you have your PackageId object, you use the OneSpan SignApprovalService to pass the PackageId object and SignerId string as parameters to retrieve the signing url. For example:

```javascript
String signerId = "Signer1";
String packageid = "your_package_id";
EslClient eslClient = new EslClient(API_KEY, API_URL);
PackageId packageId = new PackageId(packageid);
String signingUrl = eslClient.getPackageService().getSigningUrl(packageId, signerId);
System.out.println(signingUrl);
```

### Results

Here is an example of what you can expect to see once you have run your code.

![](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/image(21).png)

## .NET SDK

To download the full code sample see our [Code Share](https://community.onespan.com/documentation/onespan-sign/codeshare/get-signing-url-net-sdk/) site.

After a transaction has been sent, you can create a Signer Experience for your signers. This can be done in one of the following ways:

- By creating a session token and then building URL redirect,
- By retrieving the signing URL.
- The difference between building the URL with a session token and retrieving a signing url is that a signing URL does not expire.

### Creating a Signer Experience

To create a Signer Experience, you must first create the PackageId object of your document package.

If you need a comparison to the basic object creation procedure, or if this is the first time creating a transaction, see [](https://developer.esignlive.com/guides/quick-start/creating-and-sending-a-package-net/)[Creating and Sending a Transaction](/v1/docs/creating-and-sending-a-transaction#net-sdk).

To create a Signer Experience it is important to note that the status of your transaction must be either SENT or COMPLETE. Otherwise, an exception will be thrown.

Once you have your PackageId object, you use the OneSpan SignApprovalService to pass the PackageId object and SignerId string as parameters to retrieve the signing url. For example:

```csharp
string signerId = "Signer1";
string packageid = "your_package_id";
EslClient eslClient = new EslClient(API_KEY, API_URL);
PackageId packageId = new PackageId(packageid);
string signingUrl = eslClient.PackageService.GetSigningUrl(packageId, signerId);
Debug.WriteLine(signingUrl);
```

### Results

Here is an example of what you can expect to see once you have run your code.

![](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/image(22).png)

## REST API

To download the full code sample, see our [Code Share](https://community.onespan.com/documentation/onespan-sign/codeshare/get-signing-url-rest-api/) site.

After a transaction has been sent, you can create a Signer Experience for your signers. This can be done in one of the following ways:

- By creating a session token and then building URL redirect,
- By retrieving the signing URL.
- The difference between building the URL with a session token and retrieving a signing url is that a signing URL does not expire.

### Creating a Signer Experience

To create a Signer Experience, you must first create the PackageId object of your document package.

If you need a comparison to the basic object creation procedure, or if this is the first time creating a transaction, see [](https://developer.esignlive.com/guides/quick-start/creating-and-sending-a-package-net/)[Creating and Sending a Transaction](/v1/docs/creating-and-sending-a-transaction#net-sdk).

To create a Signer Experience it is important to note that the status of your transaction must be either SENT or COMPLETE. Otherwise, an exception will be thrown.

Once you have your PackageId, you will then need to retrieve the role id and make the following request:

#### HTTP Request

```http
GET /api/packages/{packageId}/roles/{roleId}/signingUrl
```

#### HTTP Headers

```http
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key
```

#### Response Payload

```json
{
    "roleId": "2jsTTXD2dZMZ",
    "url": "https://sandbox.e-signlive.com/auth?target=https%3A%2F%2Fsandbox.esignlive.com\r\n%2Fpackages%2FnaXQwWFSQB9RkOiH6AguBCkXp2k=%2Fsign&loginToken=\r\nMi4xMDAwGpGY3JJPS55ZnNSeHBmekNxc1RzdnNJRVlBSDkZBR1RhcmxKS09aZ3M4aFZXVlpvdExrdz09",
    "packageId": "a3b023bf-db56-4c53-b36e-bd9acd0579f4"
}
```

### Results

Here is an example of what you can expect to see once you have run your code.

![](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/image(23).png)

## APEX SDK

To download the full code sample see our [Code Share](https://community.onespan.com/documentation/onespan-sign/codeshare/get-signing-url-apex-sdk/) site.

After a transaction has been sent, you can create a Signer Experience for your signers. This can be done in one of the following ways:

- By creating a session token and then building URL redirect,
- By retrieving the signing URL.
- The difference between building the URL with a session token and retrieving a signing url is that a signing URL does not expire.

### Creating a Signer Experience

To create a Signer Experience, you must first create the PackageId object of your document package.

If you need a comparison to the basic object creation procedure, or if this is the first time creating a transaction, see [](https://developer.esignlive.com/guides/quick-start/creating-and-sending-a-package-net/)[Creating and Sending a Transaction](/v1/docs/creating-and-sending-a-transaction#net-sdk).

To create a Signer Experience it is important to note that the status of your transaction must be either SENT or COMPLETE. Otherwise, an exception will be thrown.

Once you retrieved your package ID, use the encapsulated function below to pass the PackageID and RoleId as parameters to retrieve the signing url.

```plaintext
 public String getSigningUrl(String packageId, String roleId) {
    // Your implementation here
    // Example: return the signing URL based on packageId and roleId
    String signingUrl = 'https://example.com/sign?packageId=' + packageId + '&roleId=' + roleId;
    return signingUrl;
}
```

### Results

Here is an example of what you can expect to see once you have run your code.

![](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/image(24).png)
