Calling APIs
Overview
- Obtain an API.
Obtain the API from the service catalog. An API can be called only after it is published.
- (Optional) Create an application and get authorized.
For an API that is accessed using application or IAM authentication, you need to create an application and authorize the application to use the API. When you call an API, DataArts DataService verifies your identity based on the key pair (AppKey and AppSecret) of the created application.
- Call the API.
After completing the preceding steps, you can call the API.
Creating an App
- On the DataArts Studio console, locate an instance and click Access. On the displayed page, locate a workspace and click DataArts DataService.
- In the left navigation pane, choose an edition, for example, Exclusive Edition. The Overview page is displayed.
- Choose Table 1. . On the page displayed, click Create. The Create App dialog box is displayed. Set the parameters listed in
- Click OK.
After the application is created, its name and ID are displayed in the application list.
- Click an application name, and view the AppKey and AppSecret on the displayed application details page.
Figure 1 Application details page
Authorizing an Application to Use an API
- On the DataArts Studio console, locate an instance and click Access. On the displayed page, locate a workspace and click DataArts DataService.
- In the left navigation pane, choose an edition, for example, Exclusive Edition. The Overview page is displayed.
- Authorize an application to use an API in either of the following ways:
Giving API authorization:
- Choose .
- Locate the row that contains the API to be bound, and click View.
On the page displayed, click Authorize.
- (Optional) If Parameter Location was set to Static for an input parameter during API creation, you must set a static parameter value. If you do not set a value, the default value of the API input parameter is used.
- Set an expiry time, select an application, and click OK.
Applying for authorization:
- Choose .
- Click the name of the API you want to bind to an application.
- On the page displayed, click Permission Application.
- (Optional) If Parameter Location was set to Static for an input parameter during API creation, you must set a static parameter value. If you do not set a value, the default value of the API input parameter is used.
- Set an expiry time, select an application, and click OK.
- After the application is submitted, the authorization takes effect only after it is approved in the review center.
- After the authorization is complete, view the bound APIs on the application details page.
- In the API list, if you no longer access an API through the application, click Unbind in the Operation column.
- To test an API to which the application is bound, choose in the Operation column
- To extend the authorization period for the bound API, click Renew.
Calling an API
The only difference between the three authentication methods is the authentication content. The methods for calling APIs are the same.
- IAM Authentication: IAM authenticates API requests.
- Non-authentication: No authentication is required. You can directly call an API.
- App Authentication: Application authentication is used for calling an API.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.