Introduction
If you want users to be able to get the data or consume the data from the specified resource, you must create the Consume Web API file. This allows you to add, edit and delete the fields, objects, and collections that you want to consume from the specified resource.
To create a Consume Web API file, you must first create an access token. This contains authorization details along with the URL of the specified resource.
Prerequisites
- The URL and key-value of the API which is going to be used.
- Access Token has to be created before creating a Consume Web API file.
|
Quick Steps |
| 1 |
Open the Configuration window |
| 2 |
Open the Access Token section |
| 3 |
Create an access token |
| 4 |
Enter the details |
| 5 |
Enter the API Key-Value |
| 6 |
Add the Header, if desired, and then click Create |
| 7 |
Save the access token |
| 8 |
Click the Create New Item icon, then select the Object Type |
| 9 |
Select the Web API Type |
| 10 |
Enter the details, then click Finish |
Detailed Steps
Step 1. Open the Configuration window.
Click the Configuration icon in the top right corner of the landing page.
Step 3. Create an access token.
Click the plus icon to add the access token. Xelence opens the wizard to select the desired type of access token.
Select Other from the available options and click Next.
Step 4. Enter the details.
The important properties are:
- Name (ID): Name of the access token.
- URL: This is the URL from the specified resource that you are going to consume.
- Authentication Type: Defines how the token authorizes. Select from the below options:
- No Auth: No authorization details are required to authenticate the API.
- Basic: Username and password can be used to authenticate the API.
- Bearer: Includes security token and allows access only to the bearer of the token. Bearer token is a cryptic string, usually generated by the server in response to a login request.
- ApiKey: In this type, you need to send the Key-Value pairs(s) in Auth Headers or Query Params. In this case, the Authorization type is ApiKey.
- OAuth2: Two-step authentication. In this type, you need to enter the below details:
- Token URL: The provider's authentication server, to exchange an authorization code for an access token.
- Auth URL: The endpoint for the API provider authorization server, to retrieve the auth code.
- Client ID: An identifier associated with an application that is registered with the API provider.
- Client Secret: Specifies a secret provided by the API provider.
- Scope: Specifies the scope of access you are requesting, which may include multiple space-separated values.
- Grant Type: It is used to authorize access to protected resources in different ways. Select from the below options:
- Authorization_code: It is used by confidential and public clients to exchange an authorization code for an access token. After the user returns to the client via the redirect URL, the application will get the authorization code from the URL and use it to request an access token.
- Client_credentials: It is used by the clients to obtain an access token outside of the context of a user. This is typically used by clients to access resources about themselves rather than to access user's resources.
- Refresh_token: It is used by clients to exchange a refresh token for an access token when the access token has expired. This allows the clients to continue to have a valid access token without further interaction with the user.
- Device_code: It is used by browserless or input-constrained devices in the device flow to exchange a previously obtained device code for an access token.
- Content Type: Determines which type of content it is returning. Select from the below options:
- Application_json: The content sent or received is the JSON data.
- Application_urlencoded: The content sent or received is encoded data as key value pairs separated by '&'.
- Token Name: Name of the OAuth token used to identify the access token in the authorization request or response.
- Custom Attributes: Allows you to include custom key value pair like Client ID, client secret, etc. that can be used as part of authentication.
- Add Private Key: Allows the client to authenticate itself to the authorized server using signed JSON Web Token. If checked, displays the below properties:
- Token Descriptor: Describes the structure and content of the JWT token used.
- Algorithm: Specifies the algorithm used to sign or encrypt the JWT.
- Private Key: It is a method of client authentication where the client creates and signs a JWT using its own private key.
Step 5. Enter the API Key-Value.
The APIs use the authorization to ensure that the client requests access the data securely. Auth data can be included in the header, body, or as parameters to a request.
The important properties are:
- Key: A unique identifier used to connect to, or perform, an API call.
- Value: An alphanumeric string between 20 and 128 characters associated with the defined key.
- Add To: Select from the available options:
- Header: A field of an HTTP request or response that passes additional context and metadata about the request or response.
- QueryParam: This is appended at the end of the API endpoint URL.
The important properties are:
- Name (ID): Name of the Web API file. It will always be prefixed with wpi.
- Select Folder: This is where Xelence will save the file. You can select an existing folder.
- Access Token: An identifier used to create the Web API file.
Then, click the Finish button to create the file.
Xelence creates the Consume Web API file. The Web API file now exists and is available for further configuration.
When you have completed the wizard and created your file, it should look something like this:
What are the improvements over S3 Version 6?
This is a new process.
Related Articles
Configure the Consume Get Web API File
Configure the Consume Get Web API on a Maintenance Form with the Default Method
Configure the Consume Get Web API on a Maintenance Form using the Execute Button
This post is part of the Web API topic. Click here to open Web API Overview
#Develop
#Development Studio
#Task Steps
#Everyone
#Text Help
#Xelence
#API
#WebAPI