Layer 7 API Management

Expand all | Collapse all

Create Private Key via RESTMAN API

Jump to Best Answer
  • 1.  Create Private Key via RESTMAN API

    Posted 07-22-2018 02:51 AM

    Hi All,


    I tried to create a Provate key for testing purpose but i am getting below error:


    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <l7:Error xmlns:l7="">
    <l7:Link rel="self" uri=""/>
    <l7:Detail>HTTP 405 Method Not Allowed</l7:Detail>


    I copied the code from  https://<gateway node/cluster name>:8443/restman/1.0/doc/restDoc.html#1.0/privateKeys

    from PrivateKeyCreationContext




  • 2.  Re: Create Private Key via RESTMAN API

    Posted 07-22-2018 07:35 PM

    Dear pratysin ,

    The error is "HTTP 405 Method Not Allowed", the should indicate that you either used wrong http method, or you disabled the http method on restman service(you can double check the allowed http method by right click on restman service -> select Service Properties -> HTTP/FTP tab -> Allowed HTTP Methods).




  • 3.  Re: Create Private Key via RESTMAN API

    Posted 07-23-2018 01:43 AM

    Thanks for the reply Zhijun.


    I checked the above steps and i am already configured it correctly. I feel somewhere i am doing wrong in providing the XML code as POST method. To create a Private Key I am giving the below XML code in my POSTMAN :


    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <l7:PrivateKeyCreationContext xmlns:l7="">


    After giving this I am facing this issue.




  • 4.  Re: Create Private Key via RESTMAN API
    Best Answer

    Posted 07-23-2018 07:29 PM

    Okay, I believe you called the /restman/1.0/privateKeys endpoint, not the /restman/1.0/privateKeys/{id}.

    /restman/1.0/privateKeys only allow GET, when you create new private key, you should POST to /restman/1.0/privateKeys/{id}

    {id} is in the form of [keystore ID]:[alias]


    I done a test on gw9.3, the following is working to me,

    method: POST

    content-type: application/xml

    authentication: basic authentication

    URL: https://<gateway:port>/restman/1.0/privateKeys/00000000000000000000000000000002:srcAlias 


    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <l7:PrivateKeyCreationContext xmlns:l7="">


    note1: Your sample xml has some elements not recognized, it will cause "bad request" error

    note2: 00000000000000000000000000000002 should be the default keystore ID, you can double confirm by sending a GET request to /restman/1.0/privateKeys


    For more details and sample request, please refer to restman help,

    https://<your gateway>:8443/restman/1.0/doc/restDoc.html#1.0/privateKeys