BookmarkSubscribeRSS Feed
Chapnick
Calcite | Level 5

Greetings,

 

I need to be able to specify and pull in (GET) multiple BDN terms through the API. For example, I know the two term IDs that I need. Is there an API endpoint where I can specify those two terms? Like: /SASBusinessDataNetwork/rest/terms?id=(1010066,1010067)

 

I know that you can specify one term to return at a time like so: /SASBusinessDataNetwork/rest/terms/1010066

 

I also know you can return multiple terms with the query string, but that usually returns more results than I need.

 

I would like to know if there is a way to return multiple, specific terms with one request? Thanks!

 

 

1 REPLY 1
VincentRejany
SAS Employee

Hi

 

If you want to retrieve more than one term you can use /SASBusinessDataNetwork/rest/terms for getting all terms.

You can use the following methods as well

Getting a list of only root terms (i.e. no child terms)

GET on /SASBusinessDataNetwork/rest/terms?includeParentedTerms=false

Getting a list of all terms of a given type

Assuming the type's name is "DataSource" and the type's id is "1002003", the following three queries will get the terms that are DataSource terms.

GET on /SASBusinessDataNetwork/rest/terms?type=DataSource
GET on /SASBusinessDataNetwork/rest/terms?typeId=1002003
GET on /SASBusinessDataNetwork/rest/types/1002003/terms

Getting a list of all terms by name

The following query will get all terms named "Expense":

GET on /SASBusinessDataNetwork/rest/terms?name=Expense

The following query will get all terms with "Expense" in the name:

GET on /SASBusinessDataNetwork/rest/terms?nameContains=Expense

Getting a list of terms that contain a text string somewhere in the term

The following query will get all terms that have "Expense" somewhere in the term. "Expense" could be in the term's name, status, importance, description, requirements, links, attributes, associated items, or comments.

GET on /SASBusinessDataNetwork/rest/terms?search=Expense

Getting a list of terms with a given status

The following query will get all terms that have a status with the name "Editing".

GET on /SASBusinessDataNetwork/rest/terms?status=Editing

The following query will get all terms that have a status with the name "Editing" or "Under Review".

GET on /SASBusinessDataNetwork/rest/terms?status=(Editing,Under%20Review)

Getting a list of terms with a given importance

The following query will get all terms that have an importance with the label "High".

GET on /SASBusinessDataNetwork/rest/terms?importance=High

The following query will get all terms that have a status with the name "High" or "Critical".

GET on /SASBusinessDataNetwork/rest/terms?importance=(High,Critical)

If there are multiple term types with different labels for the importance values, the following query will get all terms with a 5 star importance:

GET on /SASBusinessDataNetwork/rest/terms?importance=5

If there are multiple term types with different labels for the importance values, the following query will get all terms with a 4 or 5 star importance:

GET on /SASBusinessDataNetwork/rest/terms?importance=(4,5)

Getting a list of terms by contact user

Use the following query to get all the terms that have John Doe (whose user id is johndoe) as a contact on the term.

GET on /SASBusinessDataNetwork/rest/terms?contact=johndoe
Hope that helps
Vincent

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 579 views
  • 0 likes
  • 2 in conversation