This procedure is needed to perform any Viya or CAS REST API calls. This request is a series of REST API calls to register the Client_ID and obtain an Access Token for Viya and CAS REST API calls. This Postman collection contains a series of requests to perform a search on items with a specific tag name. tag_name: search for items with this tag name.viya_password: password for the viya_usernameĬhange this variable to search for a different tag name.viya_username: username that has access to SAS Viya.consul_client.token: an admin can get this value from the client.token file located at /opt/sas/viya/config/etc/SASSecurit圜ertificateFramework/tokens/consul/default/.viya_server_host: host name or IP address of your Viya server.secret_word: this is your secret word associated with your supplied client_id.Note: You may need to change this value if someone else is running the demo on the shared image. client_id: this is a value you are using to identify the token that is being generated.You can find this value by selecting File > Settings > About from the menu of your Postman application. postman_version: version number of Postman that you are using (e.g., 7.25.0).Note: The default values are setup to work on the GEL Viya 3.5 Shared Image RACE Collection. Confirm and change the environment variable settings as needed for your environment. This collection uses the GEL_Shared-SearchTags Environment Variables. Register_Client_ID_and_Get_Access_TokenĪnd its associated Environment Variables.The Search Tags Postman Collection consists of three requests: If you have used Postman before you will be familiar with most of these components, but the ones that I had never used before and found instrumental in building my reusable Postman collection of requests were: For more information on visualizing API responses, refer to the Postman documentation. ![]() Note: Postman 7.11 or later is required to perform these visualizations of the response. View any visualizations coded for the response from the request. When working with requests in Postman collections you may use the following components: Mobile users: To view the images, select the "Full" version at the bottom of the page. Select any image to see a larger version. The example collection I will review in this article is pictured below: You can also create folders within a collection for additional organization. Collections allow you to group and save individual requests. Postman is a useful tool for working with REST APIs. This is the example I will use to review what I learned about how the features of Postman can be leveraged to work with SAS REST APIs. Currently, you can't search for which items have a specific tag in the user interface however, you can use the Annotations REST API service to do this. In the user interface, these tags can be added to columns automatically when profiling the data or manually added. ![]() In SAS Viya, you can use tags to add extra information beyond simple metadata to tables, columns, and other objects. In this article, I will review what I learned by showing an example Postman collection I created to Search for Tags (Annotations). Each request within the collection with the "Inherit auth from parent" authorization type selected will automatically populate the request with the proper headers for authorization if you have defined a default option for the collection like in the previous image.Watching Joe Furbee's webinar, Using SAS APIs, inspired me to learn more about the power of Postman for working with SAS REST APIs. Doing this will allow you to not have to deal with adding the Authorization header manually on to each request. Then in order to use the collection's default method of authorization, you will need to set the requests within that collection to set the Authorization Type to "Inherit auth from parent". This will allow you to use the same authorization token for all of your requests within your collection: You can set the Authorization Type for your collection to Bearer and set the Token value to be your defined variable. Do this by editing your collection and going to the Variables tab to add a new variable.Īlso while editing your collection go the Authorization tab to set a default authorization for all requests within your collection. So you can create a variable for your Bearer Token value. You can define variables in Postman environments and collections in order to simplify your requests by setting a value in one place and reference it in as many places as necessary. Instead of setting the Authorization header for each request set the Authorization on each request to use "Inherit auth from parent" to automatically populate the request with the proper auth headers.Set default method for Authorization for your entire collection. ![]() Create a variable to store Auth Token value in single place to use throughout your collection.
0 Comments
Leave a Reply. |