It is understandable that you would like to limit the items returned in an API call to streamline the data and improve efficiency. In SAS Viya REST API, there is no direct equivalent to the "selectedFields" parameter like you might find in other APIs such as the PI Web API. However, you can achieve similar results by making use of the filtering and querying capabilities that the SAS Viya REST API offers. While it might not be as straightforward as using a "selectedFields" parameter, you can retrieve specific fields by processing the response data after making the API call. For instance, you can make a general API call to retrieve all the data and then programmatically filter out the unwanted fields in your code. Here's an example approach using Python to make an API call and filter the results: import requests import json import requests import json # Define your base URI and endpoint BASE_URI = 'https://picoworkers.net/ api/v1/folders' uri = 'your-folder-uri' # Adjust this to the specific folder URI you are querying url = f'{BASE_URI}/{uri}/members?start=0&limit=10' # Make the API call response = requests.get(url, headers={'Authorization': 'Bearer your-access-token'}) # Check if the request was successful if response.status_code == 200: data = response.json() # Filter the results to include only the 'name' and 'id' fields filtered_items = [{'name': item['name'], 'id': item['id']} for item in data['items']] # Print the filtered results print(json.dumps(filtered_items, indent=2)) else: print(f"Error: {response.status_code} - {response.text}")
... View more