» Required Endpoints

Required Endpoints

To successfully develop a plugin for WebCommander, it’s essential to understand the required endpoints for communication with the platform. These endpoints facilitate the installation and uninstallation of your plugin. Here, we outline the necessary endpoints and provide examples in various programming languages for your reference.

Install Endpoint

When a client initiates the installation process for your WebCommander plugin, the platform will first look for your /install endpoint. You must develop this endpoint to handle specific payloads provided by WebCommander. Based on the response from your /install endpoint, WebCommander will determine which modules your plugin needs access to and complete the installation process within the client’s site.

Example Implementations

curl --location --request GET 'https://yourapp.com/install?uuid=F8A3-A88E-C6EF-B1CB' \
--form 'token="517e58080ddddf80d2f23b1783a2a457"' \
--form 'accessToken="11b4ec017714ef095b8e115545467fcb"' \
--form 'clientSecret="6b73c5a273cf49300dbec9b8abf83a06"' \
--form 'clientId="48eaecb5dc079f039cb09b50ab9cae54"' \
--form 'refreshToken="1db5045139d1e701b72f8046d2d17135"' \
--form 'encryptionKey="CIaGf7Ely0ykfBOi94hEPUAacyaHmjB4oZHc0JMVLMM="' \
--form 'apiUrl="http://5289d153.wc-stage.webcommander.com/"' \
--form 'adminPanel="https://stage-my.webcommander.com/"'

Request Details

Request URL: https://yourapp.com/install?uuid=F8A3-A88E-C6EF-B1CB

Request Method: GET

Request Parameter
Name
Type
Required
Description
token
String
Yes
Token is used as a verifier to communicate with WebCommander APIs.
adminPanel
String
Yes
WebCommander dashboard URL of the site where the plugin is requested to install.
accessToken
String
Yes
Access token is used as a verifier to communicate with WebCommander APIs.
clientId
String
Yes
A unique identifier for users.
clientSecret
String
Yes
Client secret protects system resources by granting tokens.
refreshToken
String
Yes
A unique key for a client to request new access token.
encryptionKey
String
No
A validation algorithm to encode a secret key.
scope
String
No
Permissions granted for authentication.
Response
{
    "webhooks": [
        {
            "sourceUrl": "https://example.com/api/v1/webhooks/get",
            "eventName": "DummyEvent1",
            "renderScope": "",
            "accessType": "webhook"
        },
        {
            "sourceUrl": "https://example.com/api/v1/webhooks/submit",
            "eventName": "DummyEvent2",
            "renderScope": "",
            "accessType": "webhook"
        }
    ],
    "scriptTags": [
        {
            "sourceUrl": "https://yourapp.com/assets/js/script-tag.js",
            "eventName": "DummyName",
            "renderScope": "All",
            "accessType": "scriptTag"
        }
    ],
    "widgets": [
        {
            "widgetName": "WidgetABC",
            "widgetLabel": "DummyWidget",
            "widgetTitle": "DummyWidget",
            "widgetLogo": "https://example.com/assets/images/widget-icon.svg",
            "sourceUrl": "https://example.com/DummyWidget/Index",
            "configurationUrl": "https://example.com/DummyWidgetSettings/Index"
        }
    ],
    "customerProfileTabs": [
        {
            "customerProfileTabIdentifier": "ProfileTab1",
            "customerProfileTabDisplayName": "Tab1",
            "customerProfileTabSourceUrl": "https://example.com/Tab1"
        },
        {
            "customerProfileTabIdentifier": "ProfileTab2",
            "customerProfileTabDisplayName": "Tab2",
            "customerProfileTabSourceUrl": "https://example.com/Tab2"
        },
        {
            "customerProfileTabIdentifier": "ProfileTab3",
            "customerProfileTabDisplayName": "Tab3",
            "customerProfileTabSourceUrl": "https://example.com/Tab3"
        }
    ],
    "apiAccessScopes": [
        "customer_create"
    ]
}

Uninstall Endpoint

When a client initiates the uninstallation process for your WebCommander plugin, WebCommander will call your /uninstall endpoint. This endpoint must be developed to handle specific payloads provided by WebCommander. The payload contains data related to the client’s site, which your plugin will use to perform necessary cleanup operations.

Example Implementations

curl --location 'https://yourapp.com/uninstall?uuid=F8A3-A88E-C6EF-B1CB'

Request Details

Request URL: https://yourapp.com/uninstall?uuid=F8A3-A88E-C6EF-B1CB

Request Method: GET

Request Parameter
NameTypeRequiredDescription
uuidStringrequiredThe uuid of the site where the plugin is requested to uninstall.
Response

{
    "status" : 200, // or error code
    "Message" : 'Success' // or error message
}