Upload Server Certificate to the Inventory

This API is used to upload a single server certificate to the AppViewX server certificate inventory.

Before you begin

  • The user has the ACF permission to upload a certificate within the uploaded certificate’s category.

Request Structure

Endpoint: /cert-upload-server-certificate
Type: POST
Sample URL:
https://<IP/HostName/TenantName>:<GWPORT>/avxapi/cert-upload-server-certificate?gwsource=external

To understand the elements of the sample URL, click here.

Table 1. Input Parameters
Name Description
sessionId

Header

(Mandatory) Session ID received after login.

Type: String

Constraints: Required if username and password are not provided.
username

Header

(Mandatory) Username that is configured in AppViewX.

Type: String

password

Header

(Mandatory) Password of that user.

Type: String

content-type

Header

(Mandatory) Payload content-type with application/json value.

Type: String

Constraint: The value must be application/json.

gwsource

Query

(Mandatory) The source from which the request is triggered, e.g., external.

Type: String

Payload

payload

Contains all the parameters to be sent in the request body for the post request.

Type: Payload (Refer Payload table below)

Payload

Table 2. Payload
Name Description
groupName (Optional) Group associated with the certificate.

Type: String

fileName (Mandatory) Name of the certificate file that has to be uploaded.

Type: String

fileContent (Mandatory) Certificate file data encoded and uploaded as a raw binary stream.

Type: byte[]

certificateCategory (Optional) Certificate category.

Type: String

Possible values: Server

Constraints: Parameter value cannot be CA.

wold (Mandatory) ID of the work order for the upload request.

Type: String

Response Structure

Response returns string of type application/json with the following body parameters:

Table 3. Error Response Parameters
Name Description
response Contains the response attributes.
message Success message of the action or failure description in case of an error.

Type: String

appStatusCode Application specific status code for the response. It is a non-null value for a failure response.

Type: String

tags Additional information in case of failure response.
Name Description
message Success message or failure description in case of error.

Type: String

uuid Uuid of the uploaded certificate.

Type: String

commonName Common name of the uploaded certificate.

Type: String

category Category of the uploaded certificate.

Type: String

id Unique identifier of the certificate.

Type: String

avxStatus Status of the certificate in Appviewx. (Managed, Monitored, Discovered)

Type: String

Status Codes

HTTP Code appStatusCode Response Message
200 Success NA Certificate uploaded successfully.
400 Bad Request VALIDATION_ERROR_0004 Mandatory field is missing or invalid - value.

Remediation: Ensure that the mandatory field specified in the error message is present in the payload and has the accepted value.

401 Unauthorized AVX_GW_003 Authentication failed, reason - Invalid Credentials.

Remediation: Ensure that valid username and password or valid sessionId is provided as header parameter.

403 Forbidden AVX_GW_005 User does not have access to the targeted API.

Remediation: Ensure that the given user has the proper ACF permissions to upload a certificate.

500 Internal Server Error avx-common-011 Internal Server Error.

Sample Request/Response

Request Payload
{
    "payload": {
      "groupName": "Default",
      "fileName": "testAlbpushBind.appviewx.com.crt",
      "fileContent": (base64-encoded certificate content),
      "certificateCategory": "server",
      "woId": "NA"
    }
 }
Response
{
  "response": {
    "uuid": "977f0f2acf5c3613b16034298a20ed04d36b9df6",
    "message": "Certificate has been uploaded successfully.",
    "commonName": "testAlbpushBind.appviewx.com",
    "category": "Server",
    "id": "68396eeb4533c80d36219cda",
    "avxStatus": "Managed"
  }
}

References

Understanding the sample URL
  • IP/HostName/TenantName: Replace with the actual IP address, hostname, or tenant name based on the specific configuration in AppViewX.
    • IP: A unique identifier assigned to each device connected to a computer network that uses the Internet Protocol for communication

      The IP address will be included in the endpoint URL for an on-prem deployment.

    • HostName: A human-readable label assigned to a device (host) on a network

      The hostname will be included in the endpoint URL for an on-prem deployment.

    • TenantName: An identifier label for a tenant given to indicate which tenant's data the API request will access/modify

      The tenant name will be included in the endpoint URL for a SaaS deployment.

  • GWPORT: AppViewX gateway port

    A gateway port refers to a network port through which data is sent and received to communicate with a gateway in an on-prem deployment.

    Example: 31443

  • avxapi: Path parameter value (static) that is part of the endpoint's URL
  • Endpoint: Endpoint of the API, for example: execute-hook
  • gwsource: Source or origin of a gateway, for example: external.