Skip to main content

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" error16803iADAF50A0C0450FE0.png

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?

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?


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.


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 blackpearlBin) and execute the SmartObject against the same ID, does it return a result?


 


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.





Reply