Creating a WebSocket API
You must have the API Gateway's manage APIs or activate/deactivate APIs functional privilege assigned to perform this task.
You need the WebSocket port to access the WebSocket API. Assigning global and API-specific policies is similar to assigning policies to REST or SOAP APIs.
Note:
You can not apply global policies and policy templates to a WebSocket API.
To create a WebSocket API from scratch
1. Click APIs in the title navigation bar.
2. Click Create API.
3. Select Create from scratch.
4. Select WebSocket.
5. Click Create.
6. Provide the following information in the Basic information section:
Field | Description |
Name | Name of the API. |
Version | Version of the API. |
Description | Description of the API. |
7. Click Continue to provide technical information for this API>.
Alternatively, you can click Technical information to go to the Technical information section.
Click Save to save the API at this stage and provide the technical information for the API at a later time.
8. Provide the following information in the Technical information section:
a. Type the WS URL in the WS Url field.
The format used is ws://hostname:port/path.
b. Click + Add parameter and provide the following information:
Field | Description |
Name | Name of the parameter. |
Description | Description of the parameter. |
Type | Specifies the parameter type. Available values are - Query-string, Header. |
Data type | Specifies the data type. Available values - String, Date, Date time, Integer, Double, Boolean. |
Required | Select this to specify that the parameter is required. |
Array | Select this to specify that the array is required. |
Value | Type the required value and click + to add the value. Click to include multiple values. |
c. Click + Add message and provide the following information.
Field | Description |
Origin | Specifies the origin of the message. Available values: Server, Client. |
Type | Specifies the message type. Available types: Text, Binary |
Sample message payload | Provide the sample message payload. |
Message description | Provide the message description. |
Click
to include multiple messages.
9. Click Save.