Creating a WebSocket API
Before you begin
You must have the API Gateway's manage APIs or activate/deactivate APIs functional privilege assigned to perform this task.
About this task
To create a WebSocket API from scratch
Procedure
- Click APIs in the title navigation bar.
- Click Create API.
- Select Create from scratch.
- Select WebSocket.
- Click Create.
-
Provide the following information in the
Basic information section:
Field Description Name Name of the API. Version Version of the API. Team Team to which the API must be assigned. This option is visible only if you have enabled the Teams feature.
You can select more than one team. To remove a team, click the
icon next to the team to be removed.
Description Description of the API. -
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.
-
Provide the following information in the
Technical information section:
-
Type the WS URL in the
WS Url field.
The format used is ws://hostname:port/path.
-
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 are: 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.
-
Click
+ Add message and provide the following
information.
Field Description Origin Specifies the origin of the message. Available values are: Server, Client.
Type Specifies the message type. Available types are: Text, Binary
Sample message payload Provide the sample message payload. Message description Provide the message description. Click
to include multiple messages.
-
Type the WS URL in the
WS Url field.
- Click Save.