Home Forum Blog Market Events Resources
Showing results for 
Search instead for 
Do you mean 
Highlighted
Contributor
Posts: 23
Registered: ‎02-01-2018

SMO Rest Service - 405 method not allowed

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" error405error.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?

Moderator
Moderator
Posts: 986
Registered: ‎05-08-2012

Re: SMO Rest Service - 405 method not allowed

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?

K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member.
Contributor
Posts: 23
Registered: ‎02-01-2018

Re: SMO Rest Service - 405 method not allowed

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.

Moderator
Moderator
Posts: 986
Registered: ‎05-08-2012

Re: SMO Rest Service - 405 method not allowed

[ Edited ]

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?

 

K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member.
Contributor
Posts: 23
Registered: ‎02-01-2018

Re: SMO Rest Service - 405 method not allowed

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.