Authstate and Browse/status: 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 checks the status of an authorization key.
This operation returns the status of a web browsing certification.
 
If the authkey is authorized, it also returns information about the authorizing user account.


= URL =
= URL =
<nowiki>https://www.safestamper.com/api/authstate</nowiki>
<nowiki>https://www.safestamper.com/api/browse/status</nowiki>


= Parameters =
= Parameters =
* '''sharedkey''': Your API client shared key
* '''sharedkey''': Your API client shared key
* '''authkey''': Authkey to check status
* '''code''': The certification code received in the [[browse/stamp]] bringback URL
* '''signature''': Parameters signature, as explained in [[Signature parameter]]
* '''signature''': Parameters signature, as explained in [[Signature parameter]]


Line 15: Line 13:
A JSON object with the following fields:
A JSON object with the following fields:


* '''authkey''': Authkey value
* '''code''': The certification code
* '''authorized''': State of authkey (true|false).
* '''status''': Certification status
 
** ''RUNNING'': The browsing session is still running
If authorized parameter is true the user info is added:
** ''PENDING_CERTIFICATION'': The browsing session was completed, but the certification is being processed
 
** ''FINISHED'': The certification has been completed and the certificate PDF is ready for download
* '''state''': State of Safe Stamper user (ACTIVE|DISABLED)
** ''CANCELLED'': The user cancelled the browsing session
* '''userCode''': Safe Stamper code of the authorizing user.
* '''certificateUrl''': Certificate download URL (for ''FINISHED'' status)
* '''userMail''': Mail of the authorizing user.
* '''userName''': Full name of the authorizing user.
* '''accountType''': Account type of the authorizing user (BASIC|PREMIUM).
* '''userType''': User type of the authorizing user (INDIVIDUAL|ORGANIZATION|OPERATOR).
* '''mainUserAuthkey''': Authkey of main user for authorized operators.
* '''availableCertificates''': Available certification credits to use web static, mail, file and photo services.
* '''availableNavigations''': Available certification credits to use browsing session services.
* '''availableSignedDocuments''': Available signature credits to create signed documents.
* '''availableTimestamps''': Available timestamp credits to use tsa services.
* '''availableDiskSpace''': Available disk space quota
* '''maxCertificateSize''': Máx size in bytes for certificates
* '''maxCertificateSizeMb''': Máx size in MB for certificates


= HTTP Errors =
= HTTP Errors =


* '''403''' Forbidden: sharedkey or signature are not valid, or the authkey does not belong to the sharedkey
* '''403''' Forbidden: the sharedkey or signature are not valid, or the specified job does not belong to the API client
* '''404''' Not found: the authkey does not exist
* '''404''' Not found: the certification code is not correct.


= Example =
= Example =
Line 44: Line 30:
REQUEST:
REQUEST:
<pre>
<pre>
https://www.safestamper.com/api/authstate
https://www.safestamper.com/api/browse/status
?authkey=0021d81c-e4a5-4869-8384-2fd70cdb58ec
?sharedkey=5hmpod0d2vx7fnh6ysxab3olz
&sharedkey=axvmfqn8aex21mxhq5zsj7l482saxfu7j4hh
&code=161209-2DVSJZ
&signature=f9e0222c2fcacbea7923552128a9d395d122e963
&signature=d7d141d923775616a12800ce52a5dc327919c29c
</pre>
</pre>


Line 53: Line 39:
<pre>
<pre>
{
{
    "accountType":"PREMIUM",
  "code":"161209-2DVSJZ",
    "authkey":"0021d81c-e4a5-4869-8384-2fd70cdb58ec",
  "status":"FINISHED",
    "authorized":true,
  "certificateUrl":"http://www.safestamper.com/certificate/161209-2DVSJZ"
    "availableCertificates":50,
    "availableNavigations":3,
    "availableTimestamps":10,
    "availableDiskSpace": 113435435
    "maxCertificateSize":"22500000"
    "maxCertificateSizemB":"15"
    "state":"ACTIVE",
    "userCode":"1612020000541",
    "userMail" : "apitest@safecreative.org",
    "userName":"Api User Test"
    "userType":"INDIVIDUAL"
}
}
</pre>
</pre>

Latest revision as of 15:27, 17 October 2023

This operation returns the status of a web browsing certification.

URL

https://www.safestamper.com/api/browse/status

Parameters

  • sharedkey: Your API client shared key
  • code: The certification code received in the browse/stamp bringback URL
  • signature: Parameters signature, as explained in Signature parameter

Returns

A JSON object with the following fields:

  • code: The certification code
  • status: Certification status
    • RUNNING: The browsing session is still running
    • PENDING_CERTIFICATION: The browsing session was completed, but the certification is being processed
    • FINISHED: The certification has been completed and the certificate PDF is ready for download
    • CANCELLED: The user cancelled the browsing session
  • certificateUrl: Certificate download URL (for FINISHED status)

HTTP Errors

  • 403 Forbidden: the sharedkey or signature are not valid, or the specified job does not belong to the API client
  • 404 Not found: the certification code is not correct.

Example

REQUEST:

https://www.safestamper.com/api/browse/status
?sharedkey=5hmpod0d2vx7fnh6ysxab3olz
&code=161209-2DVSJZ
&signature=d7d141d923775616a12800ce52a5dc327919c29c

RESPONSE (actual response has no line breaks or indentation):

{
   "code":"161209-2DVSJZ",
   "status":"FINISHED",
   "certificateUrl":"http://www.safestamper.com/certificate/161209-2DVSJZ"
}