All Documents
Natural Language ProcessingNatural Language Processing
- what's new
- Service Overview
- Getting Started
- API Reference
-
FAQs
- How Do I Obtain a User Token Using Postman?
- What Should I Do If an NLP API Call Fails?
- Which Methods Can Be Used to Call NLP APIs?
- Must I Subscribe to NLP Before Calling NLP APIs?
- Can NLP Be Deployed on Premises?
- Can I Use NLP Offline?
- What Are Restrictions for Using NLP?
- What Are the Username, Domain Name, and Project Name in the Token Message Body?
- Regions and AZs
- What Permissions Do I Need to Use NLP?
- What Should I Do If I Want to Customize NLP?
- Which Languages Can NLP Process?
- More Documents
Calling NLP APIs Using Postman
NLP enables you with natural language processing capabilities with open APIs using Postman.
The following describes how to call a word segmentation API:
No. |
Operation Procedure |
Reference |
---|---|---|
1 |
Register and authenticate a public cloud account using your real name. NOTE:
If you have an account that has passed real-name authentication, skip this step and use your existing account. |
For details, see 1. |
2 |
Configure the environment. Download and install Postman and the configuration file. |
For details, see 2. |
3 |
Call the API. Use Postman to call the API and check the returned result, status code, and error code. NOTE:
The returned result is in JSON format. You need to process the recognition result through writing code. |
For details, see 3. |
Procedure
- Register and authenticate a public cloud account using your real name.
If you do not have a public cloud account, register one. If you have an account that has passed real-name authentication, skip this step and use your existing account.
- Visit https://www.huaweicloud.com/intl/en-us/ and click Register in the upper right corner. The registration page is displayed.
- Fill in user information as instructed to complete the registration.
- Click the username in the upper right corner to enter the My Account page. Then click Real-Name Authentication in the left navigation pane.
- Perform real-name authentication as prompted.
- Configure the environment.
- Download and install Postman. Select an appropriate version. Version 7.24.0 is recommended.
Only a registered account can log in and obtain the latest version of Postman.
- Download the SDK configuration file of Postman:
NLP_API.postman_collection.zip. Decompress the file to obtain a JSON file.
- Load the SDK configuration file.
- Download and install Postman. Select an appropriate version. Version 7.24.0 is recommended.
- Call the API.
- Obtain the token.
- On the Postman page, choose get-token in the navigation tree on the left. Click the Body tab, add the HUAWEI CLOUD username, password, and region ap-southeast-3 where NLP is deployed. See the following figure.
- name in user indicates the IAM username and password indicates the password.
- name in domain indicates the account name.
- name in project indicates the region name, for example, ap-southeast-3. For details, see section "Endpoints" in the Natural Language Processing API Reference.
The region where the HUAWEI CLOUD service for obtaining the token is located must be the same as the region where the called service is located. Otherwise, the calling will fail.
- Click Send in the upper right corner to send POST https://iam.ap-southeast-3.myhuaweicloud.com/v3/auth/tokens. Obtain the token in Headers (the validity period of the token is 24 hours) and project ID at the end of Body.
- On the Postman page, choose get-token in the navigation tree on the left. Click the Body tab, add the HUAWEI CLOUD username, password, and region ap-southeast-3 where NLP is deployed. See the following figure.
- Call the word segmentation API.
- Click segment. On the Headers tab page, copy the token to X-Auth-Token.
- Click Body, modify the body parameters according to , and click Send to obtain the result.
- Click segment. On the Headers tab page, copy the token to X-Auth-Token.
- Obtain the token.