# Simple Sign

```javascript
export interface AbstractSimpleSign {
  getInfo(): Promise<GenericT1CResponse<SimpleSignInfoResponse>>;
  initializeContext(origin: string): Promise<GenericT1CResponse<SimpleSignInitializeResponse>>;
  uploadFileContext(origin: string, request: SimpleSignUploadFileContextRequest): Promise<GenericT1CResponse<SimpleSignUploadFileContextResponse>>;
}

export interface SimpleSignInfoResponse {
  version: string;
  localFolder: string;
}

export interface SimpleSignInitializeResponse {
  folderBootstrap: string;
  folderExternalUploaded: string;
  folderExternalSigned: string;
  filexOrigin: string;
  filexEntity: string;
  filexTypes: Array<string>;
}

export interface SimpleSignUploadFileContextResponse {
  origin: string;
  entity: string;
  filename: string;
  callback: string;
  externalId: string;
}

export interface SimpleSignUploadFileContextRequest {
  filename: string;
  callback: string;
  externalId: string;
}  
```

## Functions

## Get SimpleSign module object

```javascript
T1CSdk.T1CClient.initialize(config).then(res => {
    client = res;
    let simplesign = client.simplesign();
}, err => {
    console.error(error)
})
```

### Info

```javascript
simplesign.getInfo();
```

The response will look like

```
{
    "success": true,
    "data": {
        "version": "0.2.5",
        "localFolder": "/Users/someuser/Desktop/simplesign"
    }
}
```

## Initialize context

```javascript
let origin = 'https://acc-rmc.t1t.io';
simplesign.initializeContext(origin);
```

The response will look like

```
{
    "success": true,
    "data": {
        "folderBootstrap": "/Users/someuser/Desktop/simplesign",
        "folderExternalUploaded": "/Users/someuser/Desktop/simplesign/_uploaded/_external",
        "folderExternalSigned": "/Users/someuser/Desktop/simplesign/_archived/_external",
        "filexOrigin": "https://acc-rmc.t1t.io",
        "filexEntity": "SimpleSign",
        "filexTypes": [
            "UPLOAD",
            "SIGNED"
        ]
    }
}
```

### Upload file context

```javascript
let origin = 'https://acc-rmc.t1t.io';
let request = {
    "filename": "T1T_test.pdf",
    "callback": "https://test.app",
    "externalId": "123456"
}
simplesign.uploadFileContext(origin, request);
```

The response will look like

```
{
    "success": true,
    "data": {
        "origin": "https://acc-rmc.t1t.io",
        "entity": "SimpleSign",
        "filename": "T1T_test.pdf",
        "callback": "https://test.app",
        "externalId": "123456"
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://t1t.gitbook.io/t1c-js-guide-v3/other/simple-sign.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
