Clarity Service Management

Expand all | Collapse all

REST webservices , Obtain Access Key

Jump to Best Answer
  • 1.  REST webservices , Obtain Access Key

    Posted 07-28-2016 06:15 AM

    Hi,

     

    I want to connect to SDM using REST web services. I'm using SOAPui as a tool to connect.

     

    Below is the example is from CA SDM guide;

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    Example Obtain an Access Key

    This REST API example demonstrates how to obtain an access key (login) for userid ServiceDesk. Perform this operation using SSL to avoid risking an unauthorized user stealing your secret key. Keep the force_unique_userid Options Manager option enabled at all times. When you disable this option, and multiple contact records with the same login ID exist, problems with data partitions, multi-tenancy, security, and other functions can occur.

    The following example shows the request:

    POST /caisd-rest/rest_access HTTP/1.1 
    Host: hostname
    Content-Type: application/xml;charset=UTF-8
    Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    Before I can obtain the Access Key, I need to know the "Authorization Key".
    Where I can get the Authorization Key (QWxhZGRpbjpvcGVuIHNlc2FtZQ==)?


     

     



  • 2.  Re: REST webservices , Obtain Access Key

    Posted 07-28-2016 08:04 AM

    Hi Mohd Hizam Ahmad,

    Take a look at this documentation page: REST HTTP Methods - CA Service Management - 14.1 - CA Technologies Documentation

    There is some information there regarding the authorization key (just search for the word "authorization" when on the page).  I believe there is a sample rest call which shows you how to obtain the authorization key.

    I believe this is what you are looking for.

    Hope this helps,
    Jon I.



  • 3.  Re: REST webservices , Obtain Access Key

    Posted 08-01-2016 11:57 AM

    Hi hizam - Did jJon_Israel's response help answer your question? If so please mark as Correct Answer. Thanks!



  • 4.  Re: REST webservices , Obtain Access Key
    Best Answer

    Posted 08-01-2016 08:50 PM

    Hi Hiazam

     

    As discussed in our support case, you need to make a POST using the rest_access method to get back the access_key

     

    Here is the call in raw format:

     

    POST http://server1:8050/caisd-rest/rest_access HTTP/1.1

    Accept-Encoding: gzip,deflate

    Content-Type: application/xml;charset=UTF-8

    Authorization: Basic U2VydmljZURlc2s6Zmx5JGF3YXk=

    Content-Length: 14

    Host: server1:8050

    Connection: Keep-Alive

    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

     

    <rest_access/>

     

    And the response in xml format:

     

    <rest_access id="400408" REL_ATTR="400408" COMMON_NAME="1713767291">

    <link href="http://server1:8050/caisd-rest/rest_access/400408" rel="self"/>

    <access_key>1713767291</access_key>

    <expiration_date>1470692742</expiration_date>

    </rest_access>

     

    Here is the screenshot from SoapUI:

     

     

     

    Hope it helps.

    Regards,

    Gordon.



  • 5.  Re: REST webservices , Obtain Access Key

    Posted 08-02-2016 12:52 AM

    Hi,

     

    Now I'm able to obtain an access key. Thanks for your help.Gordon_Preston

     

     



  • 6.  Re: REST webservices , Obtain Access Key

    Posted 08-02-2016 07:50 AM

    Hi Gordon_Preston,

     

    I want to fetch the populated items from the status drop down list in incident form as well as in problem and request form.

    Is any REST API available for doing the above operation?

     

    I referred the document also but it doesn't help me.

     

    Your help on this will be verymuch helpful for me.

     

    Thanks & Regards,

    Kumaresan M



  • 7.  Re: REST webservices , Obtain Access Key

    Posted 08-02-2016 09:30 PM

    Hi Kumaresan,

     

    The incident/problem/request status information is stored in the crs object so you would use:

    "GET /caisd-rest/crs"

     

    Hope that this helps

    Gordon.



  • 8.  Re: REST webservices , Obtain Access Key

    Posted 08-03-2016 05:49 AM

    Hi Gordon_Preston,

     

    Thank you so much.

     

    I tried the above object but it returns the entire available statuses .

    I just want to fetch the populated items from the status drop down list.

     

    So any filters available for this?

     

    Regards,

    Kumaresan M



  • 9.  Re: REST webservices , Obtain Access Key

    Posted 08-03-2016 08:46 PM

    Kumaresan,

     

    See this link for details on using a where clause in a GET request. To see the attributes of the crs object that you can use to filter on, run the following command on the Service Desk server:

    bop_sinfo -d crs

     

    Regards,

    Gordon.



  • 10.  Re: REST webservices , Obtain Access Key

    Posted 08-03-2016 11:59 PM

    Hi Gordon_Preston,

     

    Thats Great, Thank you so much gordon.

    I have another one query.

     

    is any REST API available to Update or insert the activity log for incident/request/problem?

     

    Your help on this would be great!!

     

    Thanks & Regards,

    Kumaresan M