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

Hello, 

 

I am a new user for sas viya and now I am trying to get familar with it on the remote desktop using pdc image. I am tring to create a session using the curl method showed in this link: https://developer.sas.com/apis/cas/rest/v3.0.1/apidoc.html, which is "

curl -n -X PUT http://cloud.example.com:8777/cas/sessions  

I tried to use http://sasserver.demo.sas.com:8777/cas/sessions and I got an HTTP 403 error there. May I ask if somebody know why is that? It's just simply I don't have the permission or it is because I need to use some other link?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
alexal
SAS Employee

@xiaoys0725,

 

You get HTTP 403 because you are providing no credentials.  You can send in Basic Auth credentials (in real-world, only advisable over HTTPS) or an OAuth token in theAuthorization header.

View solution in original post

6 REPLIES 6
alexal
SAS Employee

@xiaoys0725,

 

You get HTTP 403 because you are providing no credentials.  You can send in Basic Auth credentials (in real-world, only advisable over HTTPS) or an OAuth token in theAuthorization header.

xiaoys0725
Fluorite | Level 6

Thanks but may I ask what is the credentials for sasserver.demo.sas.com:8777/cas/sessions? 

xiaoys0725
Fluorite | Level 6

Hello, I solved the problem, thank you! But I got another question: is there a CAS Rest api for the cas table? Or is there anyway that I can get data from caslib directly?

alexal
SAS Employee

@xiaoys0725,

 

Yes, fetch action fetches rows from a table or view.

xiaoys0725
Fluorite | Level 6

Thank you. I tried fetch and then it works. But I came across another issue, I am trying to use angularjs to get access to the data, then I need to upload my html files somewhere on the server so I can get access to. I created a new file folder called"test" by sasstudio in /home/sasdemo, and upload my html files there. But I found I cannot open it by "sasserver.demo.sas.com/home/sasdemo/test/test.html". Do you know if there is a way to upload my html file on the server so that I can get access to my web page through URL?

alexal
SAS Employee

@xiaoys0725,

 

Do you know if there is a way to upload my html file on the server so that I can get access to my web page through URL?

Yes, in /var/www/html. You need to have root (or sudo) access to the server.