POST /api/tenants/{FedmemberID}/theme/{theme}/pki

Adds PKI information for the specified tenant theme.

Note: Before uploading the security certificate and assigning it in the Community Manager developer portal, you must define it in Policy Manager so that trust is established. For instructions, see Import CA Certificate (Policy Manager help).

Authorization Roles/Permissions: Must be logged in. Must have Modify permission for the tenant; Site Admin or Business Admin.

This topic includes the following sections:

HTTP Method

POST

URL

https://{hostname}/api/tenants/{FedmemberID}/theme/{theme}/pki

Sample Request

The example below shows upload of a digital certificate. The request body includes the keystore file name, alias name, password, and content.

Sample Request URL

https://{hostname}/api/tenants/acmepaymentscorp/theme/clone/pki?keystorePass=soa&alias=gencert&aliasPass=soa&forceTrust=false

Sample request headers

Accept: text/html,application/xhtml+xml,application/xml
Content-Type: multipart/form-data; boundary=---------------------------75021945131717
Host: acmepaymentscorp
Cookie: _ga=GA1.2.126252262.1516220845; _mkto_trk=id:629-REV-7
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

The example below has been abbreviated for display purposes.

-----------------------------75021945131717
Content-Disposition: form-data; name="path"; filename="acmepaymentscorp_cert.jks"
Content-Type: application/octet-stream
þíþí\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0001\u0000\u0000\ . . .
-----------------------------75021945131717
Content-Disposition: form-data; name="keystorePass"
soa
-----------------------------75021945131717
Content-Disposition: form-data; name="alias"
acmepaymentscorp_cert
-----------------------------75021945131717
Content-Disposition: form-data; name="aliasPass"
soa
-----------------------------75021945131717
Content-Disposition: form-data; name="X-Csrf-Token_acmepaymentscorp"
TokenID%3D7529bcc2-9046-11e8-ac6f-e9decb05b61d%2Cexpiration . . .

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept application/json, application/xml, application/vnd.soa.v85+json
Content-Type multipart/form-data
Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies.
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Request Parameters

Parameter Parm Type Data Type Required Description
FedmemberID Path String Required Unique ID for a specific tenant. Same as TenantID.
theme Path String Required The name of the platform theme.
fileName Body The uploaded file Required The uploaded PKI file; for example, acmepaymentscorp.p12.
alias Query String Required Specifies the alias in the keystore that the platform should use.
keystorePass Optional String Optional Optional keystore password.
aliasPass Optional String Optional Optional alias password. Can be omitted if not needed or if the value is the same as the keystore password.
forceTrust Optional Boolean Optional Default: false. If this parameter is included and set to true, the information is added to the trust store if not trusted already. If this parameter is included and set to false, and the information is not trusted, an error is returned.

Response

If successful, this operation returns HTTP status code 200, with information about the digital certificate that was uploaded.

Sample Response

The sample response below shows successful completion of this operation.

Sample response headers: application/json

Cache-Control: no-cache, no-store
Content-Type: text/html
Date: Wed, 25 Jul 2018 20:36:23 GMT
Location: http://acmepaymentscorp.com/api/acmepaymentscorp/theme/clone/pki

Sample response body: application/json

In this example, the response content is wrapped in HTML.

<!DOCTYPE html><html lang="en" status="201" statusText="success"><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta name="description" content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris lacus elit, ornare eget luctus vel, porta id elit. Maecenas molestie, libero sit amet blandit faucibus, orci nisi aliquet nisi, id mollis mauris ipsum a enim. Morbi lacus velit, placerat sit amet luctus eget, pulvinar a massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi eleifend tincidunt pellentesque. Cras eu sapien massa, vitae rutrum sapien. Aenean id condimentum sem. Suspendisse tempor luctus ipsum, vel metus."></head><body status="201" statusText="success">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;&lt;PKIAndCertificateInfo xmlns=&quot;http://soa.com/uri/products/restapi/xsd/1.0&quot;&gt;&lt;privateKeyExists&gt;false&lt;/privateKeyExists&gt;&lt;publicKey&gt;MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsbK49uXtQ1tuB6+Rlw8XZDZT5uYOC/hC/WYbNJW1QX9lR/ezaLCn+UYev1lVpUESZDZn1EtLfMTuYueAqfYAYXp/Ju4gkYxSgdOfIyDLtxfG2EvNz9xZcc1n6BR7jteekiDFD6/Asc1udkO+aMjWYj7cfxQ4s8u5ULtniqGTC2Ea3vynTDHAmunVqqogwFZBuiaDnOO8e4NHc9QavKZ6kTIoHM47nY9zaJdRDwPWmT9h9PVy43vetcSjaMqFmZvHdYdJpIOKCnnSB4pkSxHy8ZbAZaTuEC2LJ1OCYP06gmUHuyC9AKheV59Y4Oq1mmZLqGEAkRDgv+nBvfwLFQo0BQIDAQAB&lt;/publicKey&gt;&lt;certificateInfo&gt;&lt;subjectDN&gt;CN=GenCert, OU=acmepaymentscorpBilling, O=acmepaymentscorp, L=NA, ST=FL, C=US&lt;/subjectDN&gt;&lt;issuerDN&gt;CN=GenCert, OU=acmepaymentscorpBilling, O=acmepaymentscorp, L=NA, ST=FL, C=US&lt;/issuerDN&gt;&lt;serialNo&gt;1532468375&lt;/serialNo&gt;&lt;effectiveDate&gt;1532468375000&lt;/effectiveDate&gt;&lt;expirationDate&gt;1564004375000&lt;/expirationDate&gt;&lt;/certificateInfo&gt;&lt;Links&gt;&lt;Link rel=&quot;delete&quot; href=&quot;http://testing.acmepaymentscorp.com/api/tenants/acmepaymentscorp/theme/clone/pki&quot;/&gt;&lt;Link rel=&quot;self&quot; href=&quot;http://testing.acmepaymentscorp.com/api/tenants/acmepaymentscorp/theme/clone/pki&quot;/&gt;&lt;/Links&gt;&lt;/PKIAndCertificateInfo&gt;</body></html>

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type application/json, application/xml, application/vnd.soa.v85+json

Response Body

Name Type Description
PKIInfo PKIInfo The response includes information about the digital certificate that was uploaded.

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.