Newoperator and Newuser: Difference between pages

From SafeStamper API documentation
(Difference between pages)
Jump to navigation Jump to search
api>Admin
(Created page with "This operation creates an authorized operator for the subscription. The operator can use the suscription account but just allow manage the own data and certificates = URL = <...")
 
m (1 revision imported)
 
Line 1: Line 1:
This operation creates an authorized operator for the subscription. The operator can use the suscription account but just allow manage the own data and certificates
This operation creates a user in Safe Stamper, or creates an authorization for an existing Safe Stamper user.


= URL =
= URL =
<nowiki>https://www.safestamper.com/api/newoperator</nowiki>
<nowiki>https://www.safestamper.com/api/newuser</nowiki>


= Parameters =
= Parameters =
* '''authkey''': Authkey of main user
* '''sharedkey''': Your API client shared key
* '''sharedkey''': Your API client shared key
* '''signature''': Parameters signature, as explained in [[Signature parameter]]
* '''signature''': Parameters signature, as explained in [[Signature parameter]]
* '''mail:''' user mail
* '''mail*:''' user mail
* '''firstName?:''' first name of the user
* '''firstName?:''' first name of the user
* '''lastName?:''' last name of the user
* '''lastName?:''' last name of the user
* '''address1:''' user address line 1
* '''address2:''' user address line 2
* '''zip:''' user address zip code
* '''city:''' user address zip city
* '''countrycode:''' user address country ISO code (Default 'ES')
* '''language:''' user preferred language (es|en) Defaults to the language of the api client.
* '''notifyActivity:''' (true|false) whether the user wants to receive an e-mail with a list of the e-mail certificates that have been generated with the user's account each day.
Partners may include this param:
* '''accounttype''': account type that will be enabled to the user (professional|corporate)
<nowiki>*</nowiki> Required parameter
(?): At least provide one field (First or last name)
= Returns =
= Returns =


Line 18: Line 33:
* '''authorized''': State of authkey (true|false).
* '''authorized''': State of authkey (true|false).
* '''state''': State of Safe Stamper operator (ACTIVE|DISABLED)
* '''state''': State of Safe Stamper operator (ACTIVE|DISABLED)
* '''userCode''': Safe Stamper code of the authorizing operator.
* '''userCode''': Safe Stamper code of the user.
* '''userMail''': Mail of the authorizing operator.
* '''userMail''': Mail of the user.
* '''userName''': Full name of the authorizing operator.
* '''userName''': Full name of the user.
* '''accountType''': Account type of the main user (PREMIUM).  
* '''accountType''': Account type of the main user (BASIC|PREMIUM).  
* '''userType''': User type of the authorizing operator (OPERATOR).
* '''userType''': User type of the user (INDIVIDUAL|ORGANIZATION).  
* '''mainUserAuthkey''': Authkey of main user for authorized operator.  
* '''availableCertificates''': Available certification credits to use web static, mail, file and photo services.
* '''availableCertificates''': Available certification credits to use web static, mail, file and photo services.
* '''availableNavigations''': Available certification credits to use browsing session services.
* '''availableNavigations''': Available certification credits to use browsing session services.
Line 34: Line 48:
* '''400''' Bad Request: the countrycode or accounttype are not valid, or firstname and lastname are empty  
* '''400''' Bad Request: the countrycode or accounttype are not valid, or firstname and lastname are empty  
* '''401''' Unauthorized: accounttype is sended but you are not a partner
* '''401''' Unauthorized: accounttype is sended but you are not a partner
* '''403''' Forbidden: the sharedkey is not valid, is mail exists in Safe Stamper and user is deleted
* '''403''' Forbidden: the sharedkey is not valid, or the e-mail address already exists in Safe Stamper or Safe Creative
* '''429''' Forbidden: user doesn't have quota available for create new operator
* '''432''' Forbidden: user doesn't have professional subscription enabled


= Example =
= Example =
Line 42: Line 54:
REQUEST:
REQUEST:
<pre>
<pre>
https://www.safestamper.com/api/newoperator
https://www.safestamper.com/api/newuser
?authkey=0021d81c-e4a5-4869-8384-2fd70cdb58ec
?accounttype=premium
&mail=api.operator@safecreative.org
&mail=apitest@safecreative.org
&firstname=Api%2C+Operator
&firstname=Api%2C+User
&lastname=1
&lastname=Test
&address1=C%2F+Bari%2C+39%2C+2%C2%AA+Planta
&address2=%28Sede+Central%29
&zip=50197
&city=Zaragoza
&countrycode=ES
&language=es
&sharedkey=axvmfqn8aex21mxhq5zsj7l482saxfu7j4hh
&sharedkey=axvmfqn8aex21mxhq5zsj7l482saxfu7j4hh
&signature=35e157d8539fd66ca385fabb8967d4e8f180056f
&signature=35e157d8539fd66ca385fabb8967d4e8f180056f
Line 53: Line 71:
RESPONSE (actual response has no line breaks or indentation):
RESPONSE (actual response has no line breaks or indentation):
<pre>
<pre>
{
{
  "accountType": "PREMIUM",
    "accountType":"PREMIUM",
  "authkey": "22644c3d-668c-492f-bef9-6ecf0fa8e495",
    "authkey":"8639e12a-810c-4c51-8a62-c1b0fcf58bfd",
  "authorized": true,
    "authorized":true,
  "state": "ACTIVE",
    "availableCertificates":50,
  "availableCertificates": 50,
    "availableNavigations":1,
  "availableNavigations": 6,
    "availableTimestamps":10,
  "availableTimestamps": 0,
    "maxCertificateSize":"22500000"
  "maxCertificateSize": 7500000,
    "maxCertificateSizemB":"15"
  "maxCertificateSizeMb": 5,
    "state":"ACTIVE",
  "userCode": "1812100000748",
    "userCode":"1612020000541",
  "userName": "Api Operator 1",
    "userMail" : "apitest@safecreative.org",
  "userMail": "api.operator@safecreative.org",
    "userName":"Api User Test"
  "userType": "OPERATOR",
    "userType":"INDIVIDUAL"
  "mainUserAuthkey": "0021d81c-e4a5-4869-8384-2fd70cdb58ec"
}
}
</pre>
</pre>

Latest revision as of 15:27, 17 October 2023

This operation creates a user in Safe Stamper, or creates an authorization for an existing Safe Stamper user.

URL

https://www.safestamper.com/api/newuser

Parameters

  • sharedkey: Your API client shared key
  • signature: Parameters signature, as explained in Signature parameter
  • mail*: user mail
  • firstName?: first name of the user
  • lastName?: last name of the user
  • address1: user address line 1
  • address2: user address line 2
  • zip: user address zip code
  • city: user address zip city
  • countrycode: user address country ISO code (Default 'ES')
  • language: user preferred language (es|en) Defaults to the language of the api client.
  • notifyActivity: (true|false) whether the user wants to receive an e-mail with a list of the e-mail certificates that have been generated with the user's account each day.

Partners may include this param:

  • accounttype: account type that will be enabled to the user (professional|corporate)

* Required parameter

(?): At least provide one field (First or last name)

Returns

A JSON object with the authkey status, as returned in authstate:

  • authkey: Authkey value
  • authorized: State of authkey (true|false).
  • state: State of Safe Stamper operator (ACTIVE|DISABLED)
  • userCode: Safe Stamper code of the user.
  • userMail: Mail of the user.
  • userName: Full name of the user.
  • accountType: Account type of the main user (BASIC|PREMIUM).
  • userType: User type of the user (INDIVIDUAL|ORGANIZATION).
  • availableCertificates: Available certification credits to use web static, mail, file and photo services.
  • availableNavigations: Available certification credits to use browsing session services.
  • availableTimestamps: Available timestamp credits to use tsa services.
  • maxCertificateSize: Máx size in bytes for certificates
  • maxCertificateSizeMb: Máx size in MB for certificates

HTTP Errors

  • 400 Bad Request: the countrycode or accounttype are not valid, or firstname and lastname are empty
  • 401 Unauthorized: accounttype is sended but you are not a partner
  • 403 Forbidden: the sharedkey is not valid, or the e-mail address already exists in Safe Stamper or Safe Creative

Example

REQUEST:

https://www.safestamper.com/api/newuser
?accounttype=premium
&mail=apitest@safecreative.org
&firstname=Api%2C+User
&lastname=Test
&address1=C%2F+Bari%2C+39%2C+2%C2%AA+Planta
&address2=%28Sede+Central%29
&zip=50197
&city=Zaragoza
&countrycode=ES
&language=es
&sharedkey=axvmfqn8aex21mxhq5zsj7l482saxfu7j4hh
&signature=35e157d8539fd66ca385fabb8967d4e8f180056f

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

{
     "accountType":"PREMIUM",
     "authkey":"8639e12a-810c-4c51-8a62-c1b0fcf58bfd",
     "authorized":true,
     "availableCertificates":50,
     "availableNavigations":1,
     "availableTimestamps":10,
     "maxCertificateSize":"22500000"
     "maxCertificateSizemB":"15"
     "state":"ACTIVE",
     "userCode":"1612020000541",
     "userMail" : "apitest@safecreative.org",
     "userName":"Api User Test"
     "userType":"INDIVIDUAL"
}