Endpoint: !initCustomerSession

https://secure.trust-provider.com/products/download/!initCustomerSession

The !initCustomerSession API action creates a session, enabling the display of the Validation Manager tool to the end user for the associated certificate order on your side.

Use the POST method for this endpoint.

Submit parameters in the x-www-form-urlencoded format.

The following table lists the required and optional parameters.

Parameter Type Requirement Max. Length Description

loginName

string

required

64 chars

Your account username.

This value is case sensitive.

loginPassword

string

required

128 chars

Your account password.

This value is case sensitive.

orderNumber

string

required

64 chars

The order number for which you want the Validation Manager tool to be displayed.

responseFormat

char

optional

1 char

Specifies the response format.

The possible options are:

  • 0 = Newline-delimited parameters (default)

  • 1 = URL-encoded parameters

Sample request

curl --location --request POST 'https://secure.trust-provider.com/products/!initCustomerSession' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'loginName=yourLoginName' \
--data-urlencode 'loginPassword=yourPassword' \
--data-urlencode 'orderNumber=yourOrderNumber'

Response

The MIME type will be text/plain, if the responseFormat=0 (by default).

The response consists of two or more lines. The first line is an errorCode.

If the errorCode is less than 0, the second line displays the errorMessage, describing the error.

If the errorCode equals 0, the response consists of three lines:

  • line 1 = errorCode.

  • line 2 = SID — Identifier of a created session handle (type=string, max size=16 chars).

  • line 3 = orderNumber — Order number of a certificate which the Validation Manager page is made available for. If the given order (request parameter orderNumber) has replacements, the most recent replacement of the order number will be returned.

The MIME type will be application/x-www-form-urlencoded, if the responseFormat=1.

Response parameters

The following table displays the content that can appear in the response.

Parameter Type Description

errorCode

integer

A numeric code that identifies the type of error.

For more information, see Error codes.

errorMessage

string

A description of the error.

This parameter is not present when errorCode=0.

SID

Session handle.

This parameter is only present when errorCode equals 0.

orderNumber

The order number of a certificate which the Validation Manager page is made available for.

If the given order (request parameter orderNumber) has replacements, the most recent replacement order number will be returned.

This parameter is only present when errorCode equals 0.

Sample success response

errorCode=0&SID=aBCDEpZYXWjcmSE

Sample error response

-17
Request used GET rather than POST!

Error codes

The following table outlines error responses returned by the initCustomerSession API endpoint. Each error response consists of an errorCode and an errorMessage indicating why the request failed.

Error code Error message Description

-1

Request was not made over https!

The request must use HTTPS protocol.

-2

'xxxx' is an unrecognised argument!

The provided argument is not recognized.

-3

The 'xxxx' argument is missing!

The required argument is missing from the request.

-4

The value of the 'xxxx' argument is invalid!

The argument value does not meet validation requirements.

-14

An unknown error occurred!

An unknown error occurred.

-16

Incorrect login details, account is locked, password has expired or your source IP is blocked.

Authentication failed due to incorrect login details, a locked account, an expired password, or a blocked source IP address.

-17

Request used GET rather than POST!

The request method should be POST.

-42

Call limit reached! Please try again later

The maximum number of allowed API requests has been exceeded. Please wait before submitting additional requests.

-43

Certificate is not in a revocable state

The certificate cannot be revoked in its current state.

-160

Failed to revoke certificate.

The certificate revocation failed due to a general error.