Attask API Username Search Case Sensitive

折月煮酒 提交于 2019-12-02 11:40:29

问题


I'm currently trying to use Attask API's to pull out a list of users based on a string parameter, using the name_Mod "contains".

So far so good, I can pull back a list of usernames and their corresponding ID's but I've found that the api appears to be case sensitive.

For example, I give it the parameter "Dan"...

"https://wibble.attask-ondemand.com/attask/api/user/search?sessionID=wibble&$$LIMIT=2000&name=Dan&name_Mod=contains&fields=ID,name"

...and I get results like "Daniel Brown"

I give it "dan"...

"https://wibble.attask-ondemand.com/attask/api/user/search?sessionID=wibble&$$LIMIT=2000&name=dan&name_Mod=contains&fields=ID,name"

...I get results like "Rachael Jordan", but no "Daniel Brown".

Is there a way to tell Attask that I don't care about case sensitivity? To just give me both results and let me worry about it? Or a way around this particular limitation if it exists?


回答1:


There is also other MOD named cicontains where ci means case insensitive. You can use it instead.




回答2:


I have encountered a few limitations with the method Jim used.

Specifically, this query will not work as you expect.

..attask/api/project/search?status=CPL&status=CON&status_Mod=contains&$$LIMIT=2000

Only the first status is returned.

My preferred solution for searching with a "Contains" filter is this:

../attask/api/user/search?filters={firstName:['Chris','Steve','steve','Stephen','Anne']}

I feel it is easier to assemble an array programmatically as you do not have to prepend the field name.

If needed you could perform a ToUpper, ToLower and Case the first Char in the string and cover most of the

The filters verb does not respond to the field Modifier. You cannot use Not Equal, Less Than, Etc.

Hope that helps!




回答3:


You are correct search fields are case sensitive. The only way you can get both results, dan and Dan, is by including both in the rest request. An example would be

"https://wibble.attask-ondemand.com/attask/api/user/search?sessionID=wibble&$$LIMIT=2000&name=dan&name=Dan&name_Mod=contains&fields=ID,name"

Let me know if that works for you.



来源:https://stackoverflow.com/questions/25327238/attask-api-username-search-case-sensitive

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!