Solved

Indicium Basic throws "Invalid key segment" on PATCH request to view

  • 8 November 2022
  • 3 replies
  • 60 views

Userlevel 2
Badge +1

Using Indicium Universal, I am trying to update two values through a view using a PATCH request. The view in question has two columns specified as PK and 3 additional mandatory columns, all of which are supplied in the request body.

 

However, every time I execute the request, I get a 500 Internal Server Error response, and in the Indicium logs the following exception;

System.ArgumentException: Invalid key segment

As far as I can tell, all mandatory fields and primary keys are present in the request body and I am confident the URL is not missing any required segments (https://<server>/indicium/<app_id>/<app_version>/<view>). I have also tried including all the columns of the view in the request body and only updating the values of the columns to be updated, but that also resulted in the exception.

 

Am I missing anything? I am not quite sure what else I could be doing wrong or what other issue there could be that could result in this exception.

 

Thank you in advance!

icon

Best answer by Benjamin Westra 8 November 2022, 15:04

View original

This topic has been closed for comments

3 replies

Userlevel 2
Badge +1

Hi Jeroen, thank you for posting your question. Have you tried to supply the correct filtering in the URI, and try to leave out the PK values in the message body. Let me know if this helps.
 

for reference : https://docs.thinkwisesoftware.com/docs/indicium/api 

Just tried this, this does give me a 204 No Content response, but it does not seem to actually change any values.

There is an instead of trigger on the view for updates, perhaps the actual error is in there, however updating the same values in the Windows GUI seems to work just fine.

Userlevel 2
Badge +1

The problem has been found. The Indicium error occured because of an apparent improperly defined request.

After properly composing the request according to @Benjamin Westra's answer, a different fault altogether appeared, which is to be resolved in the instead of trigger.

 

Badge

Hi Jeroen, thank you for posting your question. Have you tried to supply the correct filtering in the URI, and try to leave out the PK values in the message body. Let me know if this helps.
 

for reference : https://docs.thinkwisesoftware.com/docs/indicium/api