Request
Endpoint: RequestAndCollectSMIME
https://secure.trust-provider.com/products/download/RequestAndCollectSMIME
Use the POST method for this endpoint.
Submit parameters in the x-www-form-urlencoded format.
Request parameters
The following table displays the required, optional, and conditional parameters.
| Parameter | Requirement | Type | Max.Length | Description |
|---|---|---|---|---|
|
required |
string |
64 chars |
Your account username. This value is case sensitive. |
|
required |
string |
128 chars |
Your account password. This value is case sensitive. |
|
conditional |
string |
128 chars |
The order number of a previously ordered S/MIME certificate, for which you want to provide the CSR and/or collect the certificate. Required unless |
|
conditional |
string |
16 chars |
The S/MIME product collection code.
Obtain the code by passing the If specified, the |
|
optional |
string |
32767 chars |
The PKCS#10 and Base64-encoded certificate signing request, with or without the header and footer Use this parameter if the CSR was not provided earlier, otherwise an error will occur. If the Microsoft certificate template extension is provided in the CSR, it is automatically extracted for inclusion in the certificate. |
|
optional |
char |
1 char |
Specifies whether to initiate the certificate issuance process in case all conditions for issuance have been met. |
|
required |
integer |
Specifies the type of query. The allowed values are:
|
|
|
optional |
integer |
Specifies the format of the returned certificate data. The allowed values are:
If omitted, the value defaults to |
|
|
optional |
integer |
Specifies the encoding of the returned certificate data. The allowed values are:
If omitted, the value defaults to |
|
|
optional |
string |
255 chars |
Specifies a MIME type, for example, For |
|
optional |
char |
1 char |
Specifies the validity period of the certificate. The allowed values are:
If omitted, the value defaults to Applicable only for |
Sample request
curl --location 'https://secure.trust-provider.com/products/download/RequestAndCollectSMIME' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'loginName=login_name' \
--data-urlencode 'loginPassword=login_password' \
--data-urlencode 'orderNumber=order_number' \
--data-urlencode 'queryType=1' \
--data-urlencode 'returnCertificate=Y' \
--data-urlencode 'responseType=2' \
--data-urlencode 'responseEncoding=0' \
--data-urlencode 'responseMimeType=application/x-x509-user-cert'
Response
The request is successful when the server returns a response with the status code is greater than or equal to 0.
-
2— Certificates attached. -
1— Certificates available. -
0— Request accepted and being processed by Sectigo.
Any status code less than 0 indicates an error condition.
|
The list of codes and their descriptions can be found in Error codes. |
If responseEncoding=2, the response is returned as JavaScript variable declarations.
If responseEncoding=1, the certificate(s) are available, and no error occurs, the output will consist simply of the requested binary structure.
If responseEncoding=0, the output will be formatted like one of the following:
-
If the status code is greater than
0, the output will be displayed as the value ofresponseMimeTypeortext/plain. -
If the status code is less than or equal to
0, the output will be displayed as thetext/plain.
The first line of the response represents a status code.
If the status code is less than 0, the second line is a textual representation of an error message.
If the status code is greater than 0 and showValidityPeriod=Y, the second line is the certificate validity period in the format not before DD/MM/YYYY and not after DD/MM/YYYY with a space between the dates.
14/05/2013 13/05/2014
|
Certificates issued by Sectigo always have a 'not before' time of 00:00:00 GMT and a 'not after' time of 23:59:59 GMT. |
If the status code equals 2, the response contains the encoded certificate(s):
----- BEGIN CERTIFICATE -----
Encoded Root Certificate
----- END CERTIFICATE -----
----- BEGIN CERTIFICATE -----
Encoded Intermediate Certificate
----- END CERTIFICATE -----
----- BEGIN CERTIFICATE -----
Encoded End Entity Certificate
---- END CERTIFICATE -----
Error codes
The following table outlines error responses returned by the RequestAndCollectSMIME API endpoint.
Each error response consists of an errorCode and an errorMessage indicating why the request failed.
| Error Code | Error Message | Description |
|---|---|---|
|
|
The request must use |
|
|
The provided argument is not recognized. |
|
|
The required argument is missing from the request. |
|
|
The argument value does not meet validation requirements. |
|
|
The key size in the CSR is not supported. |
|
|
An unknown error occurred. |
|
|
Authentication has failed due to one of the specified reasons. Verify your login credentials or check account restrictions. |
|
|
The request method should be |
|
|
The CSR has already been submitted for this request. |
|
|
The provided CSR has been rejected. |
|
|
The certificate cannot be collected because it has been revoked. |
|
|
The certificate cannot be collected because payment is still pending. |
|
|
The specified product type is not supported. |
|
|
The email verification process has not been completed. |