# Publish Documents

### Integrating Digital Document Signing with ADO Technologies

For clients looking to incorporate digital document signing capabilities into their platforms, ADO Technologies offers a robust solution that requires the implementation of specific web services. This guide outlines the necessary steps to enable ADO's solution to retrieve documents for signing, focusing on the RESTful web service that utilizes OAuth2 authentication and exposes essential methods for the digital signing process.

### Required Web Service Methods

To facilitate digital document signing, your platform must expose a RESTful web service with OAuth2 authentication, detailing the following methods:

#### Token Generation (Authentication)

- **Method**: POST
- **Description**: Generates an authentication token to access other methods of the service.
- **Parameters**: 
    - `grant_type` (String, FormData): Specifies the HTTP authentication type.
    - `username` (String, FormData): Assigned username for token retrieval.
    - `password` (String, FormData): Corresponding password for the assigned username.

#### Example Request:

> POST /api/token HTTP/1.1  
> Host: localhost:62859  
> Content-Type: application/x-www-form-urlencoded  
> username=admin&amp;password=password&amp;grant\_type=password

**Response Fields**:

- `access_token` (String): The issued token.
- `token_type` (String): Type of the generated token.
- `expires_in` (Int): Token validity period in minutes.
- `issued` (String): Token issuance date and time.
- `expires` (String): Token expiration date and time.

#### Retrieve Documents for Signing

- **Method**: POST
- **Description**: Returns a list of documents to be signed.
- **Parameters**: 
    - `JsonTransaction` (Json, Body): JSON object containing all transaction information in process.
    - `Authorization` (String, Header): Authentication token prefixed with "Bearer ".

#### Example Request

> ```
> POST /api/Integration/Documents HTTP/1.1
> Host: localhost:62859
> Authorization: Bearer your_access_token
> Content-Type: application/json
> {
>    "JsonTransaction": {
>        // Transaction details
>    }
> }
> ```

**Response**

An array of strings, each containing a document in base64 format to be signed.

#### Implementing the Service

- **OAuth2 Authentication**: Ensure your service supports OAuth2 for secure access control. The token endpoint must correctly handle the provided credentials to issue tokens.
- **Service Endpoints**: Implement the `Token` and `GetDocuments` methods according to the specifications, ensuring they process requests and return the expected responses.
- **Error Handling**: Properly manage exceptions and validate request parameters to return appropriate HTTP status codes and messages for error conditions.