# SignBox

This document describes the SignBox API interface that can be used by an external system to complete a Digital Signature.
The SignBox APIs are included into the remote signature server where is also installed the SmartUP component.
To use any of the functionalities described, it is needed to send a POST message to the resource: the input parameters
of the function will be the POST input parameters.
REST endpoint pattern:
`http://{SMARTSEC}/api/{resource}`
where `SMARTSEC` is the SignBox domain name and `resource` is the API to call.
Polling / result retrieval
The response to POST messages returns a job ID (for function `sign`). You can poll the operation progress status with:
`GET http://{SMARTSEC}/api/job/{jobId}`
If the response returns status `"done"`, for 60 seconds it is possible to get the operation results with:
`GET http://{SMARTSEC}/api/result/{jobId}`

Version: 2.0

## Servers

SignBox domain (HTTP)
```
http://{SMARTSEC}
```

Variables:
- `SMARTSEC`: SignBox domain name
  Default: "example.com"

## Download OpenAPI description

 - [SignBox](https://docs.namirial.app/_bundle/@l10n/fr/products/pki-on-prem/SignBox/openapi.yaml)

## Echo

 - [POST /api/echo](https://docs.namirial.app/fr/products/pki-on-prem/signbox/openapi/echo/echo.md): This function simply allows user to make a message be echoed from the SignBox for test purposes. URL: `http://{SMARTSEC}/api/echo` METHOD: POST ENCODING: multipart/form-data
## Sign

 - [POST /api/sign](https://docs.namirial.app/fr/products/pki-on-prem/signbox/openapi/sign/sign.md): This function allows user to sign a document in any of the supported signature format. The document to sign can be sent through an URL (parameter `url_in`) or through data stream (parameter `file_in`)
## Jobs

 - [GET /api/job/{jobId}](https://docs.namirial.app/fr/products/pki-on-prem/signbox/openapi/jobs/getjobstatus.md): Polling endpoint: `http://{SMARTSEC}/api/job/{jobId}` If the response returns status `"done"`, for 60 seconds it is possible to get the operation results from: `GET /api/result/{jobId}`
 - [GET /api/result/{jobId}](https://docs.namirial.app/fr/products/pki-on-prem/signbox/openapi/jobs/getjobresult.md): Result retrieval endpoint (available for 60 seconds after status is `"done"`): `http://{SMARTSEC}/api/result/{jobId}`
