Safe Stamper Web API: Difference between revisions

From Safe Creative API
Jump to navigation Jump to search
w>Jguillo
w>Jguillo
Line 26: Line 26:


== Example ==
== Example ==
Line breaks have been included in this example content for legibility, but actual callbacks include the whole JSON in a single line.


<pre>
<pre>
POST /stamper-callback HTTP/1.1
POST /stamper-callback?signature=743ae4504eb41cbfe2d2e72dac76a27613333a53 HTTP/1.1
Host: example.com
Host: example.com
Content-Type: application/json
Content-Type: application/json
Content-Length: 377
Content-Length: 377


{"jobId":"f39f2d5c-4bc6-4a15-90b5-00ebf69d0268","results":[{"url":"www.safestamper.com","status":"READY","certificateId":"160419-N3MBMN","certificateUrl":"https://arena-web.safestamper.com/certificate/160419-N3MBMN"},{"url":"www.safecreative.org","status":"READY","certificateId":"160419-G4B7BL","certificateUrl":"https://arena-web.safestamper.com/certificate/160419-G4B7BL"}]}
{
  "jobId":"c498d3e0-aedb-48fe-82d5-5dec4270318b",
  "results":[
      {"url":"http://www.safestamper.com","status":"READY","certificateId":"160419-BQS763","certificateUrl":"https://arena-web.safestamper.com/certificate/160419-BQS763"},
      {"url":"NON-VALID-URL","status":"ERROR","error":"bad-url"},
      {"url":"http://www.safecreative.org","status":"READY","certificateId":"160419-2LYD3K","certificateUrl":"https://arena-web.safestamper.com/certificate/160419-2LYD3K"}
  ]
}
</pre>
</pre>


= Example =
= Example =

Revision as of 10:54, 19 April 2016

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

Parameters signature

Safe Stamper Web API parameters signature

API operations

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

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

Callbacks

When starting a certification job with stamp you can provide a callback URL.

Once the certification job is finished, the callback URL will receive a POST call with the same JSON object as returned in the status operation.

To authenticate the callback, the request body HMAC-SHA1 will be calculated using the API client private key and will be provided as a query string parameter signature

Example

Line breaks have been included in this example content for legibility, but actual callbacks include the whole JSON in a single line.

POST /stamper-callback?signature=743ae4504eb41cbfe2d2e72dac76a27613333a53 HTTP/1.1
Host: example.com
Content-Type: application/json
Content-Length: 377

{
   "jobId":"c498d3e0-aedb-48fe-82d5-5dec4270318b",
   "results":[
      {"url":"http://www.safestamper.com","status":"READY","certificateId":"160419-BQS763","certificateUrl":"https://arena-web.safestamper.com/certificate/160419-BQS763"},
      {"url":"NON-VALID-URL","status":"ERROR","error":"bad-url"},
      {"url":"http://www.safecreative.org","status":"READY","certificateId":"160419-2LYD3K","certificateUrl":"https://arena-web.safestamper.com/certificate/160419-2LYD3K"}
   ]
}

Example