Just as in the desktop application, EET certificates can also be imported via the REST API interface.
Calling Method
You can use the HTTP method:
PUT or POST
The service is available at:
/c/{firma}/certifikat-eet/import
where {firma} is the database identifier of the company.
The following output formats are supported:
XML or JSON
Example call:
curl -sk -u jmeno:heslo -T {jmeno_souboru} -X PUT(/POST)"https://localhost:5434/c/{firma}/certifikat-eet/import?heslo={heslo}&provozovna={provozovna}"-H 'Content-Type: {content-type}' -H 'Accept: {application/xml | application/json}'
Parameters
Both parameters (password; premises) are required. The password parameter is used to unlock the certificate, and premises is the identifier of your EET business premises.
If an incorrect password or an invalid (or missing) premises value is provided, an error will occur and the operation will return a 400 status code.
Additionally, the Content-Type attribute must be included in the request header. Its value depends on the file extension of the certificate being sent:
application/x-x509-ca-cert– for .crt and .der extensionsapplication/x-pem-file– for the .pem extensionapplication/x-pkcs12– for .p12 and .pfx extensionsapplication/pkix-cert– for the .cer extension
