Insight Rest API to query custom attributes

abhilash.gudipudi October 23, 2019

Hello, 

 

I am trying to query a custom attribute through Insight Rest API,

Request: https://<<base-url>>/rest/insight/1.0/iql/objects?objectSchemaId=6&iql=ObjectId=22935

Response 200 and gives me all the info however let us say , if i have to find custom attribute in my object "status : inactive "via API how do i query them ?? 

If i want to find it on plugin advanced search it would be "Status" IN ("Inactive"), just want to know if anyone has better insight doing it via API

 

Thanks,

Abhilash 

 

 

2 answers

1 accepted

2 votes
Answer accepted
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 27, 2019

Hi @abhilash.gudipudi ,

your url would look like this:

https://<<BASE-URL>>/rest/insight/1.0/iql/objects?objectSchemaId=xx&iql=objectType="Teams"%20AND%20Status="Inactive"

 xx = id of your object schema

If your object type is called differently than "Teams", change it in the provided url.

abhilash.gudipudi November 21, 2019

Thank you @Hana Kučerová that worked ! 

0 votes
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 23, 2019

Hi,

I'm sorry, I'm not sure, what you are trying to do.

Do you want to find all objects with an inactive status using REST API?

If so, you can use IQL - REST:

https://documentation.riada.io/insight/latest/iql-rest-29324717.html

abhilash.gudipudi October 23, 2019

Hello,

 

Thanks for the quick reply, 

My use case scenario : Using Postman for my calls

From my main objecttype Teams i have around 50 teams listed which have individual custom attribute which can be filtered by Active/Inactive

My goals is to find custom attribute status inactive(attached pic) teams from the object Teams type via rest api. I have referred the link you shared which is /rest/insight/1.0/iql/objects?objectSchemaId=1&iql=ObjectType=%22Business%20area%22&resultPerPage=1

 

Could you please share sample response in my scenario 

Sample response: Which i wanted to find via rest API call 

{
"id": 154634,
"objectTypeAttributeId": 818,
"objectAttributeValues": [
{
"value": "Active",
"displayValue": "Active"
}
],

Very new to insight so might be wrong with technical words, please dont mind

abhilash.gudipudi October 23, 2019

@Hana Kučerová When using the rest API how do you query for multiple keys in the iql statement. 

 

For example

https://<<BASE-URL>>/rest/insight/1.0/iql/ObjectSchema.jspa?id=6&typeId=3&mode=object&iql="Status"="Inactive"

 

Response is finding inactive in all the schemas but we want to filter by specific schema. 

 

Thanks for your help

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events