Back to EIP

PatternCommand message invokes a remote procedure via messages to receive a response.
How Ballerina helps

Ballerina supports a rich set of network protocol connectors which you can use to invoke remote applications.

Command MessageMessagingPoint-to-Point Channel
import ballerina/http;

type UserGroupCreateRequest record {|
    string name;
    string description;
    string team_id;

type UserGroup record {
    string id;
    boolean is_usergroup;
    string 'handle;
    boolean is_external;
    int date_create;
    string created_by;
    string user_count;

type UserGroupCreationResponse record {
    boolean ok;
    UserGroup usergroup?;
    string 'error?;

final http:Client slackClient = check new ("");

service /api/v1 on new http:Listener(8080) {
    isolated resource function post createUserGroup(UserGroupCreateRequest userGroup)
    returns UserGroupCreationResponse|error {
        return slackClient->/api/usergroups\, mediaType = "x-www-form-urlencoded");