Skip to main content

How do I use a RESTful API?

  • January 14, 2022
  • 0 replies
  • 334 views

hrecker
StreamSets Employee
  • StreamSets Employee
  • 3 replies
  1. Users can find API calls via the UI -> Question mark icon (in the right upper corner) -> RESTful API. 
  2. Go to Manage > API Credentials > Use the '+' button to add a credentials
    • Give a name to your credentials, then click Save & Generate
    • This will generate the authentication token, copy the credential id and token
    • Export your ID and token:
      • export CRED_ID=”<your ID>”
      • export CRED_TOKEN="<your token>”
  3. Now you can make calls to the API, for example:

 

curl -X GET https://na01.hub.streamsets.com/security/rest/v1/currentUser -H "Content-Type:application/json" -H "X-Requested-By:curl" -H "X-SS-REST-CALL:true" -H "X-SS-App-Component-Id: $CRED_ID" -H "X-SS-App-Auth-Token: $CRED_TOKEN" -i

 

curl -X GET https://na01.hub.streamsets.com/jobrunner/rest/v1/metrics/executors -H "Content-Type:application/json" -H "X-Requested-By:curl" -H "X-SS-REST-CALL:true" -H "X-SS-App-Component-Id: $CRED_ID" -H "X-SS-App-Auth-Token: $CRED_TOKEN" -i

 

(Users can find API calls via the UI -> Question mark icon (in the right upper corner) -> RESTful API)

0 replies

Be the first to reply!

Reply