-
1. Re: REST API fields parameter
LJ LongWingFeb 7, 2017 8:44 AM (in response to Mike Chepaykin)
Mike,
I just tried, and used
http://<server>/api/arsys/v1/entry/Group/000000000000001?fields=values(Group ID,Status)
and it worked....the only difference is that I used a space instead of a + between Group and ID.
-
2. Re: REST API fields parameter
Mike Chepaykin Feb 7, 2017 9:22 AM (in response to Mike Chepaykin)Thanx, Lj. You gave me the idea to check the real url that was send via http, and I've found that all parameters were url-encoded, even the parentheses around fields list, like that:
?fields=%28Group+ID,Status%29
If I leave parentheses intact - it works. So, field names can be escaped, but parentheses in values() and assoc() parameters should not.
-
3. Re: REST API fields parameter
Jan Sierens Apr 14, 2017 7:52 AM (in response to LJ LongWing)I still get an error using a copy of your url on our server:
[
{
"messageType": "ERROR",
"messageText": "One of the items specified in the field or value list contains error.",
"messageAppendedText": "Wrong query key Status)",
"messageNumber": 124
}
]
the parameters limit,q, etc.. seem to work. But I cannot get it to work with the fields parameter. We are on 9.1.
-
4. Re: REST API fields parameter
Carl WilsonApr 14, 2017 8:32 PM (in response to Mike Chepaykin)
Welcome to the wonderful world of RESTful parsing limitations ....
Certain actions will require ASCII encoding, others XML, etc.
In RESTful, normally multiple parameters are specified in the following format:
["value1","value2",Value3"]
The key/pair values are almost always contained in "".
Cheers
Carl
-
5. Re: REST API fields parameter
Jan Sierens Apr 18, 2017 4:56 AM (in response to Carl Wilson)Hi Carl,
But I do exact the same query as specified by LJ. And also tried without Group ID to avoid spaces.
I tried to add quotes, square brackets and url encode. But none of these helped.
BTW: I'm using postman to test as proposed by BMC.
Best regards,
Jan
-
6. Re: REST API fields parameter
Peter Lundqvist May 28, 2017 1:30 PM (in response to Jan Sierens)I seem to have the same problem (9.1.00.001). Have you come up with a solution?
-
7. Re: REST API fields parameter
Jan Sierens May 30, 2017 2:56 AM (in response to Peter Lundqvist)No, sorry. Maybe I should log a ticket with BMC support.
Jan
-
8. Re: REST API fields parameter
Peter Lundqvist Jul 1, 2017 10:07 AM (in response to Jan Sierens)Support does not seem to be able to reproduce this error.
We have seen this on 9.1.0.001, 9.1.02.001, 9.1.02.002, 9.1.02.003 and 9.1.03.
I am trying to see if there are any common factors for the problem.
Infrastructure:
RHEL 7.3, Oracle 12c - all virtual machines.
Softwarestack:
ARS+CMDB+Atrium Integrator, ITSM, SRM, SLM, ProcessDesigner
Locale for the server process is sv_SE (UTF-8)
-
9. Re: REST API fields parameter
Tony Cosentino Aug 3, 2017 7:41 PM (in response to Mike Chepaykin)Any update on this REST fields issue? We also are using Remedy 9.1.x
-
10. Re: REST API fields parameter
Peter Lundqvist Aug 4, 2017 11:10 AM (in response to Tony Cosentino)Not really. I am currently persuing a case and, for what it is worth, support is not able to reproduce it.
If you are experiencing the problem and if you have the time to spare, maybe open a case? I guess it can't hurt.
In any way, I will try to report back what happens with my case.
-
11. Re: REST API fields parameter
Peter Lundqvist Aug 7, 2017 9:58 AM (in response to Peter Lundqvist)If you have this problem, try starting fiddler on the host you are experimenting and make sure it is capturing traffic. Then try it again.
Does it work for you too now?
As soon as I close fiddler or stop capturing traffic, I get the error message.
I will try to get a traffic capture of this tomorrow.
-
12. Re: REST API fields parameter
Peter Lundqvist Aug 7, 2017 10:39 AM (in response to Peter Lundqvist)1 of 1 people found this helpful"Always look at the network first. Network will show you the truth."
So... Looking at the request in wireshark when Postman communicated with the AR server gave me these two extracted HTTP GET requests:
Without fiddler capture
Hypertext Transfer Protocol
GET /api/arsys/v1/entry/User?limit=10&fields=values%28Status,Login%20Name%29 HTTP/1.1\r\n
[Expert Info (Chat/Sequence): GET /api/arsys/v1/entry/User?limit=10&fields=values%28Status,Login%20Name%29 HTTP/1.1\r\n]
[GET /api/arsys/v1/entry/User?limit=10&fields=values%28Status,Login%20Name%29 HTTP/1.1\r\n]
[Severity level: Chat]
[Group: Sequence]
Request Method: GET
Request URI: /api/arsys/v1/entry/User?limit=10&fields=values%28Status,Login%20Name%29
Request URI Path: /api/arsys/v1/entry/User
Request URI Query: limit=10&fields=values%28Status,Login%20Name%29
Request URI Query Parameter: limit=10
Request URI Query Parameter: fields=values%28Status,Login%20Name%29
Request Version: HTTP/1.1
With fiddler capture
Hypertext Transfer Protocol
GET /api/arsys/v1/entry/User?limit=10&fields=values(Status,Login%20Name) HTTP/1.1\r\n
[Expert Info (Chat/Sequence): GET /api/arsys/v1/entry/User?limit=10&fields=values(Status,Login%20Name) HTTP/1.1\r\n]
[GET /api/arsys/v1/entry/User?limit=10&fields=values(Status,Login%20Name) HTTP/1.1\r\n]
[Severity level: Chat]
[Group: Sequence]
Request Method: GET
Request URI: /api/arsys/v1/entry/User?limit=10&fields=values(Status,Login%20Name)
Request URI Path: /api/arsys/v1/entry/User
Request URI Query: limit=10&fields=values(Status,Login%20Name)
Request URI Query Parameter: limit=10
Request URI Query Parameter: fields=values(Status,Login%20Name)
Request Version: HTTP/1.1
I am not really sure of what is going wrong here - except for fiddler seemingly interfering with the traffic (not good). My gut feeling here is that the parenthesis should not be URL encoded (they can be both, but I feel this is part of the URL structure here). However, if they are encoded - the AR REST server can't handle it.
Thanks toLJ LongWing for probing me for a fiddler log. I had sort of given up.
-
13. Re: REST API fields parameter
LJ LongWingOct 4, 2017 10:41 AM (in response to Peter Lundqvist)
6 of 6 people found this helpfulPeter,
I came across something VERY interesting regarding Postman today. Internally here one of my co-workers approached me regarding using the
?fields=values(field1, field2)
and was getting the same 'Wrong query key values' that you were getting. I was reminded about this post and referenced it....but I quickly realized that while she was having the same error as you, I was also using postman in the same way, and not getting the error....so, I started comparing her Postman with MY postman and found the difference.....
Hers was Postman for Windows....
Mine was Postman for Chrome....
So...I had her install the Chrome plugin for postman and magically, hers started working just like mine was....so....I don't know why, but Postman for Windows seems to encode the URL automatically, where Postman for Chrome doesn't????
I don't have all of the answers unfortunately, but I do know that Postman for Chrome was functional in a way that Postman for Windows wasn't.
-
14. Re: REST API fields parameter
Peter Lundqvist Oct 4, 2017 11:12 AM (in response to LJ LongWing)Awesome, and a bit terrible att the same time