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!
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.
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
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
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