BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ullsokk
Pyrite | Level 9

I have seen screenshots of details showing a CAS table URI, but I can't find out where in VIYA I can find those details. Have also tried getting the URI thourgh code, which works for tables on our 9.4 environment, but not on the CAS libs. 

 

Need the URI for testing out the API functions

1 ACCEPTED SOLUTION

Accepted Solutions
Ullsokk
Pyrite | Level 9
I have the API up and running, but was struggling to find the table URIs. Turns out they can be found in the Explore Lineage pane i Viya, by searching for the table name and looking at details.

View solution in original post

2 REPLIES 2
joeFurbee
Community Manager

 Hi @Ullsokk,

I'll provide some general information about table APIs, but the more information you can provide on your task/use case, the more details I can provide.

 

First there is the Data Tables API as defined on developer.sas.com. Using curl, the most basic GET endpoint for this API takes the form:

curl -X GET https://www.example.com/dataTables/dataSources/{dataSourceId}/tables/{tableId} \
  -H 'Authorization: Bearer <access-token-goes-here>' \ 
  -H 'Accept: application/vnd.sas.data.table+json'

Here is an example url:

https://mysasserver.sas.com/dataTables/dataSources/cas~fs~cas-shared-default~fs~public/tables/CAMPAIGN_POST_TEST

 

There are many other endpoints within this API for tables. Additional examples are on GitHub.

 

You also may consider the tables CAS action set. This API provides a host of other table endpoints. 

An example of loading a table to memory API call is:

https://mysasserver.sas.com/cas-shared-default-http/cas/sessions/{{sessionid}}/actions/table.loadTable

with body contents:

{"caslib":"CASUSER(sasdemo)","importOptions":{"fileType":"AUTO"},"path":"DATA_ON_THE_FLY.sashdat"
 "casout":{"caslib":"PUBLIC","name":"flight_data","promote":true}} 
 
I hope these at least get you started on using the APIs.
 
Thanks,
Joe

Join us for SAS Community Trivia
SAS Bowl XLVI, Causal Analysis
Wednesday, December 18, 2024, at 10 a.m. ET | #SASBowl

Ullsokk
Pyrite | Level 9
I have the API up and running, but was struggling to find the table URIs. Turns out they can be found in the Explore Lineage pane i Viya, by searching for the table name and looking at details.

SAS Innovate 2025: Register Today!

 

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1633 views
  • 0 likes
  • 2 in conversation