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

Hi CI Experts, 

 

Does anyone have an REST API example to use in CI? I intend to use a process node to send data to a SMS broker (3rd part).

 

All suggestions are welcome.

 

Regards,

TF

1 ACCEPTED SOLUTION

Accepted Solutions
Dmitry_Alergant
Pyrite | Level 9

There are many things that can go wrong, and no one can tell anything without seeing the code, the log, request being sent by Postman that is successful, Response you are getting in SAS, etc.

 

This question really belongs to another community (SAS programming) - especially now that you have replicated your problem in SAS EG.

 

As a general suggestion, you can try making requests using curl command-line utility, running it directly from the SAS Compute server.

  • If you are successful, then build on that success by having your SAS script calling curl (and processing its results). This may require enabling "X" command execution in Stored Process Server and Workspace Server options - by default it is disabled. 
  • If you are not (you can call an API with Postman, but can't do the same with curl), then your question lies even beyond any SAS tool altogether - think asking for help on sites like StackOverflow, etc.

 

Hope this helps. Good luck!

-------
Dmitriy Alergant, Tier One Analytics

View solution in original post

3 REPLIES 3
Dmitry_Alergant
Pyrite | Level 9

Sorry, I can't provide you any specific code example (all of that belongs to our clients).  But your question should not be limited to just a SAS CI community.  The entire power of SAS Base language programming is available while creating a process node. You can google for REST API usage examples in SAS 9.4 platform (SAS language) in general - not necessarily originated from SAS MA / CI.   There are many different approaches and examples available online...

 

When the API is complex, some implementations I have seen included dumping the data from SAS into a CSV file and then having an external program written in other languages (ex: python) pick up the file and call the API.   Many things can be done straight from SAS (especially when few single calls need to be made). But other languages and programming environments may be better suited in other circumstances, especially when many small API calls need to made, and it needs to be done in a multithreaded way / in parallel for performance...

 

Hope this helps. Good Luck!

-------
Dmitriy Alergant, Tier One Analytics
tfabri
Obsidian | Level 7

Hi Dmitry,

 

Thank you for your response and time.

 

Actually, I've seen a lot of documents, but no success yet. First I'm trying to figure out how to recover the token. Through POSTMAN, I was successful. But when I tried to run a SAS program (SAS Guide), it does not work.

Do you believe there m be some configuration missing on the server side?

 

Thank you again.
TF

Dmitry_Alergant
Pyrite | Level 9

There are many things that can go wrong, and no one can tell anything without seeing the code, the log, request being sent by Postman that is successful, Response you are getting in SAS, etc.

 

This question really belongs to another community (SAS programming) - especially now that you have replicated your problem in SAS EG.

 

As a general suggestion, you can try making requests using curl command-line utility, running it directly from the SAS Compute server.

  • If you are successful, then build on that success by having your SAS script calling curl (and processing its results). This may require enabling "X" command execution in Stored Process Server and Workspace Server options - by default it is disabled. 
  • If you are not (you can call an API with Postman, but can't do the same with curl), then your question lies even beyond any SAS tool altogether - think asking for help on sites like StackOverflow, etc.

 

Hope this helps. Good luck!

-------
Dmitriy Alergant, Tier One Analytics
How to improve email deliverability

SAS' Peter Ansbacher shows you how to use the dashboard in SAS Customer Intelligence 360 for better results.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1292 views
  • 0 likes
  • 2 in conversation