500 error when querying workfront api Hours + parameterValues

261 Views Asked by At

When calling WorkFront's API

https://preview.workfront.com/attask/api/v7.0/HOUR/search?fields=*,parameterValues

I get a 500 error. It works fine if I don't specify parameterValues. In comparison providing a bogus field returns:

https://preview.workfront.com/attask/api/v7.0/HOUR/search?&fields=*,garbageParam

{"error":{"class":"java.lang.IllegalArgumentException","message":"APIModel V7_0 does not support field garbageParam (Hour)"}}

I can't simply remove parameterValues because the url is generated by the code, and I didn't see a means of determining if a particular ObjCode will or won't crash if given parameterValues.

My code is supposed to dump the JSON into C# classes I have, so I need all the fields that are available. Unfortunately WorkFront crashing by being requested all the fields is throwing a wrench into the design.

Is there a way to get around the 500 error, or a way to detect if paramterValues should be provided or not?

1

There are 1 best solutions below

0
michael johnson On

I am not sure why you are getting a 500 Error rather then a more specific error but Hours do not contain custom data so parameterValues would not contain any data on the HOUR object. If you were to make the same Call on the TASK object it would work.