Introduction
The REST interface offered by SWS is exposed at the path:
Code Block |
---|
http://<IP-APPLIANCE>:8080/SignEngineWeb/rest/ |
This path is composed by other sub-path for every of purpose:
- admin: method for sws like remove certificate from cache
- enquiry: contain the method for obtain the information like signatures available, signer certificate, timestamps available ecc...
- sign: this is the principal path of SWS and contain the methods for apply the signature
- timestamps: methods for apply the timestamp on every type of file
And in this guid will be described how manage the error generated by the REST interface.
ENQUIRY: certificate
Description | return the certifcate associated to "device_signer"Introduction
The REST interface offered by SWS is exposed at the path:
Code Block |
---|
http://<IP-APPLIANCE>:8080/SignEngineWeb/rest/ |
This path is composed by other sub-path for every of purpose:
- admin: method for sws like remove certificate from cache
- enquiry: contain the method for obtain the information like signatures available, signer certificate, timestamps available ecc...
- sign: this is the principal path of SWS and contain the methods for apply the signature
- timestamps: methods for apply the timestamp on every type of file
And in this guid will be described how manage the error generated by the REST interface.
ENQUIRY: certificate
Description | return the certifcate associated to "device_signer" |
HttpMethod | POST |
---|
Path | /rest/enquiry/certificate |
Request |
Expand |
---|
title | request-enquiry-certificate |
---|
| { "credentials": { "username": "device_signer" } } |
|
Response | return the byte array of certificate associated to device_signer |
ENQUIRY: signatures
Description | return the numer of signatures apposed from "device_signer" |
HttpMethod | POST |
---|
Path | |
Request |
Expand |
---|
title | request-enquiry-signatures |
---|
| { "credentials": { "username": "device_signer" } } |
|
Response | Number of signatures apposed |
ENQUIRY: signatures-available
Description | return the number of signatures which "device_signer" can apply |
HttpMethod | POST |
---|
Path | /rest/enquiry/certificatesignatures-available |
Request |
Expand |
---|
title | request-enquiry-certificatesignatures-available |
---|
| { "credentials": { "username": "device_signer" } } |
|
Responsereturn | the byte array of certificate associated to device_signerNumber of signatures available |
ENQUIRY:
signaturesotps
Description | return the numer of signatures apposed from otp list associated to "device_signer" |
HttpMethod | POST |
---|
Path | /rest/enquiry/signaturesotps |
Request | Description | return the number of signatures which
Expand |
---|
title | request-enquiry-signaturesotps |
---|
| { "credentials": { "username": "device_signer" } } |
|
Response | Number of signatures apposed |
ENQUIRY: signatures-available
Description | return the otp list associated to "device_signer" "username": "device_signer" |
can apply |
HttpMethod | POST |
---|
Path | /rest/enquiry/signatures-available |
Request | Expand |
---|
title | request-enquiry-signatures-available |
---|
|
{ "credentials": { "username": "device_signer" } } |
Response | Number of signatures available |
ENQUIRY: otps
|
Response |
Expand |
---|
title | response-enquiry-otps |
---|
| [ { "idOtp": number, "serialNumber": "string", "type": "otp-type-enum" }, { "idOtp": number, "serialNumber": "string", "type": "otp-type-enum" } ] |
|
ENQUIRY: timestamps-available
Description | return the numeber of timestamp available (valid only for Namirial TSA account) |
HttpMethod | POST |
---|
Path | /rest/enquiry/otpstimestamps-available |
Request |
Expand |
---|
title | request-enquiry-otps |
---|
| { "credentials": { "username": "device_signer" } } |
| Response | Expand |
---|
title | response-enquiry-otps |
---|
| [ { "idOtp": number, "serialNumber": "string", "type | { "timestampUrl": "otptimestamp-namirial-typeenquiry-enumurl" }, { "idOtp": number, "serialNumber "timestampUsername": "stringtsa-username", "typetimestampPassword": "otptsa-type-enumpassword" } ] |
|
Response | Number of timestamps available |
ENQUIRY:
timestamps-availableerrors
Description | return the numeber of timestamp available (valid only for Namirial TSA account)error description associated to error code |
HttpMethod | POST |
---|
Path | /rest/enquiry/timestamps-available | Request |
Request |
Expand |
---|
title | request-enquiry-errors |
---|
| { "error_code": integer, "lang": "COUNTRY-CODE-2DIGIT" } |
|
Response |
Expand |
---|
title | requestresponse-enquiry-timestamps-available |
---|
| { "timestampUrl | [ { "errorCode": integer, "errorLanguage": "timestampCONUNTRY-namirialCODE-enquiry-url2DIGIT", "timestampUsernameerrorLanguage2": "tsaCOUNTRY-CODE-username3DIGIT", "timestampPassworderrorText": "tsa-passwordDescription error in language" }
|
|
Response | Number of timestamps available |
ENQUIRY: errors
ADMIN: remove-certificate-from-cache
Descriptionreturn the error description associated to error | coderemove the certificate from cache of SWS |
HttpMethod | POSTPUT |
---|
Path | | Request | Expand |
---|
title | request-enquiry-errors |
---|
|
{ "error_code": integer, "lang": "COUNTRY-CODE-2DIGIT" } |
Responseadmin/remove-certificate-from-cache |
Request |
Expand |
---|
title | responserequest-enquiry-errors |
---|
| [ { "errorCode-remove-certificate-from-cache |
| { "error_code": integer, "errorLanguagelang": "CONUNTRYCOUNTRY-CODE-2DIGIT", "errorLanguage2": "COUNTRY-CODE-3DIGIT", "errorText": "Description error in language" }] |
|
Response |
|
Admin
Timestamps
ADMIN: remove-certificate-from-cache
Description | remove the certificate from cache of SWSTIMESTAMPS: apply
Description | permits to apply timestamp on specified file |
HttpMethod | PUTPOST |
---|
Path | /rest/admin/remove-certificate-from-cache | Request | Expand |
---|
title | request-enquiry-remove-certificate-from-cache |
---|
|
{ "error_code": integer, "lang": "COUNTRY-CODE-2DIGIT" } |
Response |
TIMESTAMPS: apply
Description | permits to apply timestamp on specified file |
Request |
|
timeStampPreferences |
Expand |
---|
title | request-timestamps-apply |
---|
| { "filenameInTSD": "string", "outputAsPDF": true, "outputAsTSD": true, "outputBase64Encoded": true, "timestampHashAlgo": "string", "timestampPassword": "string", "timestampUrl": "string", "timestampUsername": "string" } |
|
content | file to apply timestamp |
|
|
Response |
|
USER: change-password
Description | permits to change the password associated to device signer |
HttpMethod | POST |
---|
Path | /rest/timestampsuser/applychange-password |
USER: change-password
Description | permits to change the password associated to device signer |
HttpMethod | POST |
---|
Path | /rest/user/change-password |
Request timeStampPreferences(for remote device signer) |
Request (for remote
Expand |
---|
title | request-user-change-timestamps-apply |
---|
| { "filenameInTSD": "string", "outputAsPDF": true, "outputAsTSD": true, "outputBase64Encoded": true, "timestampHashAlgo": "string", "timestampPassword": "string", "timestampUrl": "string", "timestampUsername": "string" } |
|
content | file to apply timestamp |
Response |
| { "credentials": { "idOtp": idOtp or -1, "otp": "otpCode", "password": "old-password-of-device-signer-remote", "username": "device-signer-remote" }, "newPassword": "new-password-of-device-signer-remote" } |
|
Request (for automatic device signer) |
Expand |
---|
title | request-user-change-password-remoteautomatic |
---|
| { "credentials": { "idOtpsecurityCode": idOtp or -1, "otp": "otpCode"securityCode associate to automatic device signer", "password": "old-password-of-device-signer-remoteautomatic", "username": "device-signer-remoteautomatic" }, "newPassword": "new-password-of-device-signer-remote" } |
Request (for automatic device signer) |
Response | Password update succesfully |
SIGN: openSession
Description | permits to open the sessione for apply multiple sign with remote device |
HttpMethod | POST |
---|
Path | |
Request |
Expand |
---|
title | request-user-change-password-automaticsign-openSession |
---|
| { "credentials": { "securityCodeidOtp": "securityCode associate to automatic device signer" -1, "passwordotp": "old-password-of-device-signer-automatic775351", "usernamepassword": "device-signer-automatic" }12345678", "newPasswordusername": "new-password-of-device-signer-automatic"RHIP22021116852552" } } |
|
Response | Password update succesfully |
Sign
SIGN:
openSession getRemainingTimeForSession
Description | permits to open the sessione for apply multiple sign with remote deviceobtain the time until the session is valid |
HttpMethod | POST |
---|
Path | /rest/sign/openSessiongetRemainingTimeForSession |
Request |
Expand |
---|
title | request-sign-openSession |
---|
| { "credentials": { "idOtp": -1, "otp": "775351", "password": "12345678getRemainingTimeForSession |
| { "credentials": { "sessionKey": "zZto1G0DpL/vBFkTnK7caquzY5pasOlzS+bQG7wUkOONnbV7Vhd+JSPTjP7ZqTYR12QjS0W89T7UmnQB2KzAQ3C4NalDgFE67ntqoGm7uOU7+oOPLvKQv/p5aeZ2bcjKe6x5KQPUEH//rKaExFcLcLj8cnwXfFBixJ4MN+3o8S5535HcRxWv+YoTHHgAY16Fh0yJGfLL3x/4W+HJeiIYL2cHpKNTGkKcGTM8Eon0R+djNFvKzZSF1VIETPADqDdvgLYkRWODd3yoUvExGk5BcQKVm0Z7Nd7NMKl4NRbHumdqmqy81jchQv2qlXIxSpjZ0GTnL4vDZMF2MP2DGHPoWw==", "username": "RHIP22021116852552" } } |
|
Response | String with Seconds until the session is valid |
SIGN:
getRemainingTimeForSession closeSession
Description | permits to obtain the time until destroy the session is validbefore will expire |
HttpMethod | POST |
---|
Path | /rest/sign/getRemainingTimeForSessioncloseSession |
Request |
Expand |
---|
title | request-sign-getRemainingTimeForSession |
---|
| { "credentials": { "sessionKey": "zZto1G0DpL/vBFkTnK7caquzY5pasOlzS+bQG7wUkOONnbV7Vhd+JSPTjP7ZqTYR12QjS0W89T7UmnQB2KzAQ3C4NalDgFE67ntqoGm7uOU7+oOPLvKQv/p5aeZ2bcjKe6x5KQPUEH//rKaExFcLcLj8cnwXfFBixJ4MN+3o8S5535HcRxWv+YoTHHgAY16Fh0yJGfLL3x/4W+HJeiIYL2cHpKNTGkKcGTM8Eon0R+djNFvKzZSF1VIETPADqDdvgLYkRWODd3yoUvExGk5BcQKVm0Z7Nd7NMKl4NRbHumdqmqy81jchQv2qlXIxSpjZ0GTnL4vDZMF2MP2DGHPoWw==", "username": "RHIP22021116852552" } } |
|
ResponseSeconds until the session is valid |
|