Calling an API to Use Short Sentence Recognition
This section describes how to use Postman to call the Short Sentence Recognition API. The procedure is similar for other SIS APIs. The procedure is as follows:
Step 1: Configuring the Environment
Step 2: Performing Token Authentication
Step 3: Calling Short Sentence Recognition
Prerequisites
You have registered a Huawei ID and enabled Huawei Cloud services. Your account cannot be in arrears or frozen.
Subscribing to the Service
The Short Sentence Recognition service is now commercially available. You do not need to apply for OBT.
Maximum QPS: 3
Step 1: Configuring the Environment
- Download and install Postman 7.24.0.
- Download the Postman configuration file of SIS from the following path:
If the browser displays the file content, right-click the file and save it in JSON format.
- Import the configuration file.
- Open and log in to Postman.
- Choose File > Import > Import File > Choose Files to import the configuration file.
Figure 1 Importing the configuration file
After the configuration file is imported, it is displayed in the left navigation pane.
Step 2: Performing Token Authentication
- On the Postman page, click get-token in the navigation tree on the left.
- Select the Body configuration item and add the Huawei Cloud username, password, and account name. You can obtain the information on the My Credentials page.
- username: IAM username
- password: password of the IAM user
- domainname: account name
- project name: the name of the region where the service is deployed. In this example, the region is ap-southeast-3. For details about regions, see Endpoints.
Figure 2 Token-based authentication
- Click Send to send a request, and obtain and copy the token.
In Headers, obtain the value of X-Subject-Token, which is the token. The token is valid for 24 hours.
Figure 3 Obtaining a token
Step 3: Calling Short Sentence Recognition
- On the Postman page, click Short Sentence Recognition in the navigation tree on the left.
- Click Headers and replace the value of X-Auth-Token with the obtained token value.
- Replace {{ap3-project_id}} with the project ID. You can obtain the project ID on the My Credentials page.
- Click body and copy the Base64 code of the audio to the data parameter (the sample audio has been added to the configuration file).
- Click send to send the request, and then view the returned result.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot