Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use REST API

Crystal Rouse
Contributor
February 17, 2023

I am trying to build a rest query to pull specific object values from our schema.

I can find documentation at: 

https://insight-javadoc.riada.io/assets-rest/#aql_objects_get

 

I need examples of what to put after the /objects in the URL.

1 answer

0 votes
Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 17, 2023

Hello @Crystal Rouse 

Not sure what you mean by 'examples'. The endpoint documentation describes all the parameters for that endpoint and even provides examples:

Query Parameters

  • qlQuery: (string - default: "")

    The query to determine which objects that should be fetched. For example, objectType = "Computer". An empty query means all objects are fetched.

  • includeAttributes: (boolean - default: true)

    Should the objects attributes be included in the response. If this parameter is false only the information on the object will be returned and the object attributes will not be present

  • includeAttributesDeep: (integer - default: 1)

    How many levels of attributes should be included. For example, consider object A, which has a reference to object B, which has a reference to object C. If object A is included in the response and includeAttributesDeep=1, object A's reference to object B will be included in the attributes of object A, but object B's reference to object C will not be included. However, if includeAttributesDeep=2 then object B's reference to object C will be included in object B's attributes.

Crystal Rouse
Contributor
February 21, 2023

I am having trouble using the AQL syntax.  I am able to return the following:

rest/insight/1.0/aql/objects

rest/insight/1.0/objecttype/1

rest/insight/1.0/objecttype/1/attributes

I need to return the data, I am able to get a list of object and attributes but I need the data.  I can't find any good examples.  

Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2023

Sorry, I don't know what you mean by 'data'.

Asset Query Language (AQL) is a query language like JQL, CQL etc. It returns a set of objects that relate to the attributes of the assets in your Jira Service Management system. Those attributes contain 'data' about the assets.

You haven't provided any examples of any REST API query where you've attempted to form an AQL query, so it's not possible to know what you have or haven't tried so far. Have you read through the AQL documentation that describes the syntax of the language? There are dozens of examples there.

Anyhow, good luck with your learning journey.

Crystal Rouse
Contributor
February 21, 2023

I am very familiar with AQL.  

I am unable to get the Rest query to work and show the data I want.  I need an example of how to build the actual Rest query.

So, for example if I want to get all the information from my ObjectSchemaID = 1 and my objecttype=1 and where Status = Active

I can build the AQL in Assets, that is not a problem.  I just don't know what the syntax is for after the /rest/insight/1.0/aql/objects

Gordon S February 22, 2023

aql/objects?qlquery=(objecttypeid == 1 AND "Status" == Active)

 

You can use all AQL Operators (==/!=/etc...) and also "joins" via Reference Functions as mentioned in the AQL Docs.

Like Hector Florin _Appfire_ likes this
Kelsey Smith February 23, 2023

Gordon, thank you for the assistance, but we're still getting errors. The only way we've been able to get any data about our table to be returned is by the following, but it only gives us info about the table and no objects from the table:

rest/assets/1.0/objecttype/1

I then tried again adding /attributes which returns all the possible fields and associated metadata, but it still does not return the actual data in the table.

We've tried many variations of what you sent with no success. We've combed through the documentation and can't get anything to return the data in the table.

If you have any further advice, we'd greatly appreciate it. Thanks!

Gordon S February 24, 2023

Suggest an answer

Log in or Sign up to answer