CA Service Management

  • 1.  How do I use the HTTP Post Operator with Service Desk to retrieve an access key

    Posted Nov 22, 2017 12:40 PM
      |   view attached

    Hi,

     

    I'm trying to use the HTTP Get operator to retrieve a rest access_key for Service Desk Manager and am having trouble figuring out how to get it to work.  I've successfully retrieved an access key in SoapUI using the following techdoc.  In that document, it has you add <rest_access/>  to the request header, I don't see where to put this in the HTTP Get Operator and am thinking that may be the problem.

     

    Error message in SDM jrest.log file

    11/22 09:33:46.273 [http-nio-8050-exec-9] ERROR DalUtilities 180 Invalid REST Access Key (null) provided via X-AccessKey header.
    11/22 09:33:46.273 [http-nio-8050-exec-9] ERROR SDMCRUDServiceImpl 1592 Error retrieving a collection of 'rest_access' resources. Invalid REST Access Key (null) provided via X-AccessKey header. 

     

     

    If someone has an example that they can share that would be helpful.

     

    Thank you!

     

    Edit: This has been solved.  An example process has been attached to this post.  It gives an example of how to retrieve a rest access key using Basic HTTP authentication.

     

    Thank you ritri01 and Andy_Thompson for the assistance!

    Attachment(s)



  • 2.  Re: How do I use the HTTP Get Operator with Service Desk to retrieve an access key

    Posted Nov 23, 2017 06:55 AM

    Hi Grant

    I'm afraid that our US based staff who would normally respond to these forum postings are currently enjoying a two day break over the Thanksgiving holidays. As a result I regret to inform you that there will be a slight delay in responding to this query.

    I will however ensure that there is someone available to provide a response to this question as soon as possible after Monday November 27th. I hope this doesn't cause you any inconvenience and thank you for your patience during this time.  



  • 3.  Re: How do I use the HTTP Get Operator with Service Desk to retrieve an access key
    Best Answer

    Posted Dec 06, 2017 04:35 PM

    Hi Grant,

     

    The <rest_access/> actually needs to be in the body. To get a rest access key for REST you only need the Authorization header which is in the format of "Basic encodedAuth" where encodedAuth is a base64 encode of "Username:Password" Depending on what you are using you might also need to put Accept or Content-Type header and set it application/xml. Please let me know if that works out for you.

     

    Thanks,

    Anthony



  • 4.  Re: How do I use the HTTP Get Operator with Service Desk to retrieve an access key

    Posted Dec 07, 2017 10:21 AM

    @gbruneau  - did Anthony's post help you out here?



  • 5.  Re: How do I use the HTTP Get Operator with Service Desk to retrieve an access key

    Broadcom Employee
    Posted Dec 07, 2017 10:45 AM

    Grant, take a look at the sample code in \samples\sdk\rest\java\test1_basic. For example, you can see

    String endpointGET = baseURI + "/in";

    GetMethod get = new GetMethod(endpointGET);
    get.addRequestHeader("X-AccessKey", accessKey);
    get.addRequestHeader("Accept" , "application/xml");
    get.addRequestHeader("X-Obj-Attrs" , "ref_num, status, summary");

    in SampleCRUDOperations.java file.I think this is how you do the GETMethod(). Thanks _Chi



  • 6.  Re: How do I use the HTTP Get Operator with Service Desk to retrieve an access key

    Posted Dec 07, 2017 02:11 PM

    Thank you all for your input. I’ve been busy on other projects and haven’t had a chance to try this again. I will post back when I have time.



  • 7.  Re: How do I use the HTTP Get Operator with Service Desk to retrieve an access key

    Posted Dec 08, 2017 05:02 AM

    Hi Grant.

    Because the access_key is defined as the common_name of the rest_access factory, something like the following should work: assumption your access key is 1234

    http://you-sdm-host:8050/caisd-rest/rest_access/COMMON_NAME-1234

    Of course you still have to provide the access key in the X-AccessKey Header.

    hope this helps.

    Kind Regards

    ..........Michael



  • 8.  Re: How do I use the HTTP Get Operator with Service Desk to retrieve an access key

    Posted Dec 08, 2017 05:06 AM

    And just for sure. to create/get a new access key you need to use a post request.



  • 9.  Re: How do I use the HTTP Get Operator with Service Desk to retrieve an access key

    Posted Dec 08, 2017 06:01 AM

    Hi Grant,

     

    You need to use the POST as mentioned by Michael_Mueller

     

    Check the example from the documented sample codes

     

    REST HTTP Methods - CA Service Management - 14.1 - CA Technologies Documentation

     

    See also:

     

    https://www.getpostman.com/docs/postman/sending_api_requests/authorization

     

    ===

    Kind Regards,

    Brian