cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 7

API call to get Assets by Client ID or Username

Jump to solution

I'm trying to format my API call to return the Assets assigned to a client by looking up by Client ID or Username. The following is what I get when searching: /ra/Assets?qualifier=(client.id=1)&username=***&password=***

sqlStringForKeyValueQualifier: attempt to generate SQL for com.webobjects.eocontrol. (client.id = 1) failed because attribute identified by key 'client.id' was not reachable from from entity 'Asset'.

I suspect it has to do with the returned value being an array of clients. Is there a way to get this information to return?

Thank you in advance

1 Solution

I've used both syntax above but am still unable to get WHD to return any information. clients.id returns the error in the first post but clients.userName returns an empty array [ ]. Any advice?

Edit: Got this working using the ?qualifier(clients.userName%20like%20'xxx'). Problem was our systems userNames are strings and using "=" qualifier makes it case sensitive. using the "like" qualifier solved the issue.

View solution in original post

2 Replies
Level 7

I figured this out. You can use ?qualifier=(clients.userName='123456') to get the results above.

I've used both syntax above but am still unable to get WHD to return any information. clients.id returns the error in the first post but clients.userName returns an empty array [ ]. Any advice?

Edit: Got this working using the ?qualifier(clients.userName%20like%20'xxx'). Problem was our systems userNames are strings and using "=" qualifier makes it case sensitive. using the "like" qualifier solved the issue.

View solution in original post