Deleteuserpack and File/stamp: Difference between pages

From SafeStamper API documentation
(Difference between pages)
Jump to navigation Jump to search
api>Admin
 
m 1 revision imported
 
Line 1: Line 1:
This operation disables the professional services that are linked to the authorization
Sends a file to certificate.
 
It must use an HTTP multipart/form-data post request.


= URL =
= URL =
<nowiki>https://www.safestamper.com/api/deleteuserpack</nowiki>
<nowiki>https://www.safestamper.com/api/file/stamp</nowiki>


= Parameters =
= Parameters =
* '''sharedkey''': Your API client shared key
* '''sharedkey''': Your API client shared key
* '''authkey''': Authkey to disable professional services
* '''authkey''': Authkey to certificate as authorized user.
* '''file''': File to certificate
* '''storefile''': Indicate if store file in SafeStamper server ("true"|"false")
* '''signature''': Parameters signature, as explained in [[Signature parameter]]
* '''signature''': Parameters signature, as explained in [[Signature parameter]]
** '''NOTE:''' When calculating the signature use the file name as the value of ''file'' parameter


= Returns =
= Returns =


HTTP 200 OK
A JSON object with the following fields:
 
* '''entryDate''': Date of certificate
* '''code''': Code of certificate,
* '''url''': URL of certificate download
* '''properties''': JSON with the properties the certificate
** '''filename''': File name of the certificate
** '''size''': Size of file of the certificate (returned as a string)
** '''md5''': MD5 hash of file of the certificate
** '''sha1''': SHA1 hash of file of the certificate
** '''sha256''': SHA256 hash of file of the certificate
** '''sha512''': SHA512 hash of file of the certificate


= HTTP Errors =
= HTTP Errors =


 
* '''401''' Unauthorized, the authkey is not valid
* '''401''' Unauthorized: the authkey is not valid
* '''403''' Forbidden, the sharedkey or signature are not valid
* '''403''' Forbidden: the sharedkey is not valid
* '''429''' Your Safe Stamper user has no certification credits available
* '''430''' Your Safe Stamper user has no storage space available


= Example =
= Example =
Line 23: Line 40:
REQUEST:
REQUEST:
<pre>
<pre>
https://www.safestamper.com/api/deleteuserpack
https://www.safestamper.com/api/file/stamp
?authkey=0021d81c-e4a5-4869-8384-2fd70cdb58ec
 
&sharedkey=axvmfqn8aex21mxhq5zsj7l482saxfu7j4hh
Content-Type: multipart/form-data;
&signature=f9e0222c2fcacbea7923552128a9d395d122e963
boundary=90503bb6-f5b0-410f-97da-e86041ce17cd
--90503bb6-f5b0-410f-97da-e86041ce17cd
Content-Disposition: form-data; name="authkey"
 
0dbb406d-cc0c-4ef8-ae80-971ed108c2f9
--90503bb6-f5b0-410f-97da-e86041ce17cd
Content-Disposition: form-data; name="storefile"
 
true
--90503bb6-f5b0-410f-97da-e86041ce17cd
Content-Disposition: form-data; name="sharedkey"
 
axvmfqn8aex21mxhq5zsj7l482saxfu7j4hh
--90503bb6-f5b0-410f-97da-e86041ce17cd
Content-Disposition: form-data; name="signature"
 
508c8bf78d43577f1d41db0c7a3c67c07518681c
--90503bb6-f5b0-410f-97da-e86041ce17cd
Content-Disposition: form-data; name="file"; filename="test.file"
Content-Type: null
 
<<< Contents of file >>>
--90503bb6-f5b0-410f-97da-e86041ce17cd--
 
</pre>
</pre>


RESPONSE:
RESPONSE:
 
<pre>
HTTP 200 OK
{
    "entryDate":"2016-12-05T10:49:11Z",
    "code":"161205-4MR4ML",
    "url":"http://www.safestamper.com/certificate/161205-4MR4ML",
    "properties": {
        "filename":"test.file",
        "size":"3070",
        "md5":"9f7c1b879255cf5661f721d4fec6cbf2",
        "sha1":"7baf9446524cb1886f17fbd9756102b44d85585f",
        "sha256":"b42468bd6afa45d8f64c042fc116409748cdaf0214c47d8ad43aa4728ece7c03",
        "sha512":"5d04ec2d846141d2dcbc8d1d2629709dc63b8bf5b9f0e49836db527ae11c4b10ce797e184b8fa5fb0755fc444c62a93af0b0174c4d8ef68d82fe977a52dd4079"       
    }
}
</pre>

Latest revision as of 07:27, 17 October 2023

Sends a file to certificate.

It must use an HTTP multipart/form-data post request.

URL

https://www.safestamper.com/api/file/stamp

Parameters

  • sharedkey: Your API client shared key
  • authkey: Authkey to certificate as authorized user.
  • file: File to certificate
  • storefile: Indicate if store file in SafeStamper server ("true"|"false")
  • signature: Parameters signature, as explained in Signature parameter
    • NOTE: When calculating the signature use the file name as the value of file parameter

Returns

A JSON object with the following fields:

  • entryDate: Date of certificate
  • code: Code of certificate,
  • url: URL of certificate download
  • properties: JSON with the properties the certificate
    • filename: File name of the certificate
    • size: Size of file of the certificate (returned as a string)
    • md5: MD5 hash of file of the certificate
    • sha1: SHA1 hash of file of the certificate
    • sha256: SHA256 hash of file of the certificate
    • sha512: SHA512 hash of file of the certificate

HTTP Errors

  • 401 Unauthorized, the authkey is not valid
  • 403 Forbidden, the sharedkey or signature are not valid
  • 429 Your Safe Stamper user has no certification credits available
  • 430 Your Safe Stamper user has no storage space available

Example

REQUEST:

https://www.safestamper.com/api/file/stamp

Content-Type: multipart/form-data;
boundary=90503bb6-f5b0-410f-97da-e86041ce17cd
--90503bb6-f5b0-410f-97da-e86041ce17cd
Content-Disposition: form-data; name="authkey"

0dbb406d-cc0c-4ef8-ae80-971ed108c2f9
--90503bb6-f5b0-410f-97da-e86041ce17cd
Content-Disposition: form-data; name="storefile"

true
--90503bb6-f5b0-410f-97da-e86041ce17cd
Content-Disposition: form-data; name="sharedkey"

axvmfqn8aex21mxhq5zsj7l482saxfu7j4hh
--90503bb6-f5b0-410f-97da-e86041ce17cd
Content-Disposition: form-data; name="signature"

508c8bf78d43577f1d41db0c7a3c67c07518681c
--90503bb6-f5b0-410f-97da-e86041ce17cd
Content-Disposition: form-data; name="file"; filename="test.file"
Content-Type: null

<<< Contents of file >>>
 
--90503bb6-f5b0-410f-97da-e86041ce17cd--

RESPONSE:

{
    "entryDate":"2016-12-05T10:49:11Z",
    "code":"161205-4MR4ML",
    "url":"http://www.safestamper.com/certificate/161205-4MR4ML",
    "properties": {
        "filename":"test.file",
        "size":"3070",
        "md5":"9f7c1b879255cf5661f721d4fec6cbf2",
        "sha1":"7baf9446524cb1886f17fbd9756102b44d85585f",
        "sha256":"b42468bd6afa45d8f64c042fc116409748cdaf0214c47d8ad43aa4728ece7c03",
        "sha512":"5d04ec2d846141d2dcbc8d1d2629709dc63b8bf5b9f0e49836db527ae11c4b10ce797e184b8fa5fb0755fc444c62a93af0b0174c4d8ef68d82fe977a52dd4079"         
    }
}