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 XXXVIII, SAS Programming: Getting Started
Wednesday, February 14, 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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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