03-13-2018 08:09 AM
Good morning, I have been trying to figure out how to access SmartObject data through its Rest exposure, but I have failed with all my attempts.
I enabled the endpoints, when I go to the equivalent of this website <https://[server]:8443/SmartObjectServices/endpoints/endpoints.xml> I get a list of all smartobjects and their methods to be used with the Rest Service. But following these instructions https://help.k2.com/onlinehelp/k2blackpearl/devref/current/default.htm#Read.html Only lead me to a "405 Method Not allowed" error
I have specified the basic authentication, I have added the Content-type header, the documentation does not specify any other headers, and it guides to use the Get method. I figured the Get method is the easiest to test Rest Services so I haven't tried any other ones so far. Has anyone been successful in fixing this issue?
03-13-2018 09:19 AM
As this is just a Load method that accepts the ID in the URL parameter, if you just browse to this same URL using a browser from the server; does it also return 405 error?
03-13-2018 10:21 AM
When I do it from the browser on the server directly it just returns a blank page, no errors, no warnings, nothing. If I utilize something else, such as powershell with an Invoke-RestMethod it does an error 405 as well.
03-13-2018 10:57 AM - edited 03-13-2018 10:58 AM
If I miss-typed the URL, I also see a 405 error.
Are you copying and pasting the exact URL from the 'https://[server]:8443/SmartObjectServices/endpoints/endpoints.xml' file?
If I specify an ID that does not exists, I get an empty page.
If you use the SmartObject Service Tester tool (C:\Program Files(x86)\K2 blackpearl\Bin) and execute the SmartObject against the same ID, does it return a result?
03-13-2018 11:54 AM
I did copy it directly from the list. I have attached the screenshots as files to avoid cluttering the reply space, but yes SMO Service Tester Tool did return data with that same ID that I used. Forms based on that object work just fine as well, I need another product to read all the data of that SMO which is why I wanted to expose it through Rest API.