Safe Stamper Web API: Difference between revisions

From Safe Creative API
Jump to navigation Jump to search
w>Jguillo
m 29 revisions imported
 
(16 intermediate revisions by one other user not shown)
Line 4: Line 4:
* A '''private key''' used for signing your requests
* A '''private key''' used for signing your requests


To get your pair of API keys, you can contact us through [[Safe Stamper contact form | https://www.safestamper.com/contact]]
To get your pair of API keys, you can contact us through [https://www.safestamper.com/contact Safe Stamper contact form]


= Parameters signature =
= API reference =


Some API operations require a signature to authenticate the API client.
All operations may be called by POST or GET, and return their results in JSON format.


To calculate the signature, follow this steps:
== Authentication ==


* Build a string with all parameters ordered alphabetically, separated by ''&'' and '''without url-encoding'''
For authentication, all requests must include a signature parameter calculated from the request parameters and the API client private key.
* Get the bytes of the string, using UTF-8 encoding
* Get the bytes of your private key, using UTF-8 encoding
* Calculate the HMAC-SHA1 of the string bytes, with your private key bytes
* Encode the signature bytes as hexadecimal digit pairs


== Example ==
* [[Safe Stamper Web API parameters signature]]


'''Parameters:'''
== API operations ==
* url = <nowiki>https://www.google.com/search?q=Safe+Stamper&gws_rd=cr,ssl</nowiki>
* [[stamp]]: Send URLs to certificate
* sharedkey = 789lq9o6im682tl0m1rej34ls
* [[status]]: Check the status of a certification job


'''Private key: '''
== Callbacks ==
* 1omnpo704w6u2ad2lxo2wrdm5
When calling [[stamp]] you can provide a callback URL:


 
* [[Safe Stamper Web API callbacks]]
'''String to sign: '''
<pre>
sharedkey=789lq9o6im682tl0m1rej34ls&url=https://www.google.com/search?q=Safe+Stamper&gws_rd=cr,ssl
</pre>
 
'''Content bytes''' (hexadeximal):
<pre>
73 68 61 72 65 64 6b 65 79 3d 37 38 39 6c 71 39  |sharedkey=789lq9|
6f 36 69 6d 36 38 32 74 6c 30 6d 31 72 65 6a 33  |o6im682tl0m1rej3|
34 6c 73 26 75 72 6c 3d 68 74 74 70 73 3a 2f 2f  |4ls&url=https://|
77 77 77 2e 67 6f 6f 67 6c 65 2e 63 6f 6d 2f 73  |www.google.com/s|
65 61 72 63 68 3f 71 3d 53 61 66 65 2b 53 74 61  |earch?q=Safe+Sta|
6d 70 65 72 26 67 77 73 5f 72 64 3d 63 72 2c 73  |mper&gws_rd=cr,s|
73 6c                                            |sl|
</pre>
 
'''Key bytes''' (hexadecimal)
<pre>
31 6f 6d 6e 70 6f 37 30  34 77 36 75 32 61 64 32  |1omnpo704w6u2ad2|
6c 78 6f 32 77 72 64 6d  35 0a                    |lxo2wrdm5.|
</pre>
 
'''HMAC-SHA1'''
<pre>
3e e8 b6 11 39 50 c0 c8 49 4b a0 3b 4f b8 d6 16 c7 fb 9a 25
</pre>
 
'''Signature string:'''
<pre>
3ee8b6113950c0c8494ba03b4fb8d616c7fb9a25
</pre>
 
= API operations =
 
All operations return their results in JSON format.
 
* [[Single page certification | Certificate a single web page]]

Latest revision as of 08:07, 7 May 2021

API keys

To use Safe Stamper Web through API, you need a pair of keys:

  • A shared key that identifies your client application
  • A private key used for signing your requests

To get your pair of API keys, you can contact us through Safe Stamper contact form

API reference

All operations may be called by POST or GET, and return their results in JSON format.

Authentication

For authentication, all requests must include a signature parameter calculated from the request parameters and the API client private key.

API operations

  • stamp: Send URLs to certificate
  • status: Check the status of a certification job

Callbacks

When calling stamp you can provide a callback URL: