Post – Rest Methods

Estimated reading: 2 minutes 2055 views

The POST Method can be used to create a new resource/data to the collections of resources. The POST method can be used to post the required data to the resource and returns the response.

The following use case helps you to understand how the POST method from the REST activity is utilized to get the token as a response to the given URL. The input is an API which is used to correct the misspelled words. This model is known as “Spell Check” from RobilityAI model in Manager.
This API requires a token to access the URL, thus we are using the token URL to access the bearer type values and use the same token as authentication to use the spell check model. Let’s get into an example to see how this POST method works.

Steps to execute a bot

The following example helps you to get the token from the provided URL using the POST method. Here we are using the POST method as we are sending the UID & TenantID embedded with the URL as the details to be posted. The response should be returned as token number with the bearer type.

1. Drag and drop the REST activity from the webclient automation feature.
2. Double click on the activity and open the REST form.
3. Enter the URL from which the details need to be invoked and executed. Here it is https://cognitiveservices.robility.ai/token?uid=772e780b-6ba5-4313-9e09-b6a37a6a8699&tenantid=741E3787-E3A3-47D2-BF59-2F483BC42CCC
4. Choose the method as POST as we are going to post the details(i.e., UID & Tenant ID embedded with the URL)to get the token details.
5. Click on the Invoke option to get the token details.
6. Click on Save option to export the parameters to the activity.
7. Declare a variable in the text from output properties panel. Here it is “pt”
8. Add a writelog activity to get the response in the output window.
9. Enter the input string as “pt” and Log level as “info.”
10. Execute the activity. 

The bot executes the activity, uses the POST method and gets the token for the given API URL. 

Share this Doc

Post – Rest Methods

Or copy link

CONTENTS