Uploading a Certificate

Last updated: 2019-07-22 12:45:25

PDF

1. API Description

This API (CertUpload) is used to upload certificates.
API request domain name: wss.api.qcloud.com

2. Input Parameters

The list below contains only the API request parameters. The common request parameters need to be added when a call is made. For more information, see Common Request Parameters. The Action field of this API is CertUpload.

Parameter Name Required Type Description
cert Yes String Certificate content
certType Yes String Certificate type. CA: client certificate. SVR: server certificate.
key No String Certificate private key, which is required when certType = SVR.
alias No String Certificate remark

3. Output Parameters

Parameter Name Type Description
code Int Common error code. 0: Successful; other values: Failed. For more information, see Common Error Codes on the Error Codes page.
message String Module error message description depending on API
data Array Data returned by the API.

The "data" parameter contains the number of domain names in the account as well as the list of domain names.

Parameter Name Type Description
id String Certificate ID

4. Example

https://wss.api.qcloud.com/v2/index.php?
&<Common request parameters>
&Action=CertUpload
&cert=-----BEGIN+CERTIFICATE-----%0D%0AMIIFxTCCBK2gAwIBAgIQExOG1fLHj38bcWMxgd%2BcUTANBgkqhkiG9w0BAQsFADCB%0D%0AlzELMAkGA1UEBhMCQ04xJTAjBgNVBAoTHFRydXN0QXNpYSBUZWNobm9sb2dpZXMs%0D%0AIEluYy4xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxHTAbBgNVBAsT%0D%0AFERvbWFpbiBWYWxpZGF0ZWQgU1NMMSEwHwYDVQQDExhUcnVzdEFzaWEgRFYgU1NM%0D%0AIENBIC0gRzUwHhcNMTcwMzIzMDAwMDAwWhcNMTgwMzIzMjM1OTU5WjAcMRowGAYD%0D%0AVQQDDBFzYWRmZGFzZi5mLXhqLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC%0D%0AAQoCggEBAIlljWcJfs3Zc4qVhq4IhijOPt9dX3E3%2BT4z3EtPdCfZ54%2Fff9IRiR8M%0D%0AAh9f5JUWBK3aVYfv2%2BQE5GYBs6VFqLp5xpEDKEzPOm2D2qyuqGSxMyhWGQU%2BNS3i%0D%0AQMu%2BTI0PttvOpqMYnIUXyHLgRd6rX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AQUFBwMCMCkGA1Ud%0D%0AEQQiMCCkHjAcMRowGAYDVQQDExFTeW1hbnRlY1BLSS0yLTYwMTAdBgNVHQ4EFgQU%0D%0AbVjHfxrn4T8upoyXNUK79NM4rD8wHwYDVR0jBBgwFoAUf9Nlp8Ld7LvwMAnzQzn6%0D%0AAq8zMTMwDQYJKoZIhvcNAQELBQADggEBABUphhBbeG7scE3EveIN0dOjXPgwgQi8%0D%0AI2ZAKYm6DawoGz1lEJVdvFmkyMbP973X80b7mKmn0nNbe1kjA4M0O0hHaMM1ZaEv%0D%0A7e9vHEAoGyysMO6HzPWYMkyNxcCV7Nos2Uv4RvLDpQHh7P4Kt6fUU13ipcynrtQD%0D%0A1lFUM0yoTzwwFsPu3Pk%2B94hL58ErqwqJQwxoHMgLIQeMVHeNKcWFy1bddSbIbCWU%0D%0AZs6cMxhrra062ZCpDCbxyEaFNGAtYQMqNz55Z%2F14XgSUONZ%2FcJTns6QKhpcgTOwB%0D%0AfnNzRnk%2BaWreP7osKhXlz4zs%2BllP7goBDKFOMMtoEXx3YjJCKgpqmBU%3D%0D%0A-----END+CERTIFICATE-----
&certType=SVR
&key=-----BEGIN+RSA+PRIVATE+KEY-----%0D%0AMIIEogIBAAKCAQEAiWWNZwl%2BzdlzipWGrgiGKM4%2B311fcT...(omitted)...dTh0tEPGcssOuNtHEFW4RywOQVGihxe%2BcszCTo0u%2FiJSS5w8M%3D%0D%0A-----END+RSA+PRIVATE+KEY-----

The returned results are as below:

{
    "code": 0,
    "message": "",
    "codeDesc": "Success",
    "data": {
        "id": "9hyvgrkE"
    }
}