SDP.get(options)
Fetch the widget data such as URLs, or any input data in the custom widget from the server. You can also perform a cross portal call from the custom widget using this function. Note that only
SDP V3 APIs can be invoked using this function.
Example: Access a request present in the IT Portal using its URL to the HR Portal.
Parameters:
Name
| Type
| Description
|
options*
| Object
| Object which contains api details.
Property
| Type
| Description
| url*
| String
| Mention only the entity URL. The API context will be set automatically.
| input_data
| Object
| Specify the input data to be passed in the API call. Refer API documentation for input_data format.
| portalid
| Long
| Specify the instance ID to invoke cross-portal calls.
|
|
* - Mandatory parameter
Returns:
Promise - Resolved with API Success or Rejected with API Failure. Refer
API documentation for success/failure response formats.
Syntax:
- SDP.get(options).then(function(response) {
- console.log(response);
- }).catch(function(response) {
- console.log(response);
- });
Sample:
API Call
| Success Response
| Failure Response
|
SDP.get({
url: "/requests"
}).then(function(response) {
console.log(response);
}).catch(function(response) {
console.log(response);
});
| | |
SDP.add(options)
Add data to the server from the custom widget. You can also perform a cross portal call from the custom widget using this function. Note that only
SDP V3 APIs can be invoked using this function.
Parameters:
Name
| Type
| Description
|
options*
| Object
| Object which contains API details.
Property
| Type
| Description
| url*
| String
| Mention only the entity URL. The API context will be set automatically.
| input_data
| Object
| Specify the input data to be passed in the API call. Refer API documentation for input_data format. | portalid
| Long
| Specify the instance ID to invoke cross-portal calls.
|
|
* - Mandatory parameter
Returns:
Promise - Resolved with API Success or Rejected with API Failure. Refer
API documentation for success/failure response formats.
Syntax:
- SDP.add(options).then(function(response) {
- console.log(response);
- }).catch(function(response) {
- console.log(response);
- });
Sample:
API Call
| Success Response
| Failure Response
|
SDP.add({
url: "/requests",
input_data: {
request: {
subject: 'Request created from Widget'
}
}
}).then(function(response) {
console.log(response);
}).catch(function(response) {
console.log(response);
});
| | |
SDP.edit(options)
Edit data in the server from the custom widget by mentioning the entity ID. You can also perform a cross portal call from the custom widget using this function. Note that only
SDP V3 APIs can be invoked using this function.
You can also perform bulk-editing using this function.
Parameters:
Name
| Type
| Description
|
options*
| Object
| Object which contains API details.
Property
| Type
| Description
| url*
| String
| Mention only the entity URL. The API context will be set automatically.
| input_data
| Object
| Specify the input data to be passed in the API call. Refer API documentation for input_data format. | portalid
| Long
| Specify the instance ID to invoke cross-portal calls.
|
|
* - Mandatory parameter
Returns:
Promise - Resolved with API Success or Rejected with API Failure. Refer
API documentation for success/failure response formats.
Syntax:
- SDP.edit(options).then(function(response) {
- console.log(response);
- }).catch(function(response) {
- console.log(response);
- });
Sample:
API Call
| Success Response
| Failure Response
|
SDP.edit({
url: "/requests/100000000000032746",
input_data: {
request: {
subject: 'Request created from Widget'
}
}
}).then(function(response) {
console.log(response);
}).catch(function(response) {
console.log(response);
});
| | |
SDP.del(options)
Delete data in the server from the custom widget by mentioning the entity ID. You can also perform a cross portal call from the custom widget using this function. Note that only
SDP V3 APIs can be invoked using this function.

Currently, you can use this function to delete only custom module entities in ServiceDesk Plus MSP Cloud.
Parameters:
Name
| Type
| Description
|
options*
| Object
| Object which contains API details.
Property
| Type
| Description
| url*
| String
| Mention only the entity URL. The API context will be set automatically.
| ids
| String
| Entity Id. Multiple ids can be passed as a comma separated string.
| portalid
| Long
| Specify the instance ID to invoke cross-portal calls.
|
|
* - Mandatory parameter
Returns:
Promise - Resolved with API Success or Rejected with API Failure. Refer
API documentation for success/failure response formats.
Syntax:
- SDP.del(options).then(function(response) {
- console.log(response);
- }).catch(function(response) {
- console.log(response);
- });
Sample:
API Call
| Success Response
| Failure Response
|
SDP.del({
url: “/cm_webtab/100000000000032739”
}).then(function(response) {
console.log(response);
}).catch(function(response) {
console.log(response);
});
| //Refer API documentation for success response.
| //Refer API documentation for failure response.
|
SDP.refreshPage()
Refreshes the page where the widget is loaded. Note that only the page body is loaded, the application header remains untouched.
Example: If the API is called from the right panel widget in a request, request details page completely reloads.
Returns:
Promise - Resolved with Success or Rejected with Failure.
Syntax:
SDP.refreshPage() call reloads the page which in turn unloads the widget from window. Hence callback is not needed for this API.
SDP.showIndicator(options)
Displays the indicator on the application window after an operation is completed.
Parameters:
Name
| Type
| Description
|
options*
| Object
| Object which contains API details.
Property
| Type
| Description
| category*
| String
| Defines the category of the indicator.
Possible categories: success/failure/info/loading
| message
| String
| The message or information to be displayed in the indicator. This is mandatory except for Loading indicators.
| timeout
| Integer
| Defines the amount of time in milliseconds for which the indicator is displayed. You can define up to 5000 milliseconds.
This parameter is applicable to all category indicators except for the Loading indicator, which will be displayed until the SDP.hideIndicator(indicator_type) is called. |
|
* - Mandatory parameter
Returns:
Promise - Resolved with Success or Rejected with Failure.
Syntax:
- SDP.showIndicator(options).then(function(response) {
- console.log(response);
- }).catch(function(response) {
- console.log(response);
- });
Sample:
API Call
| Success Response
| Failure Response
|
SDP.showIndicator({
message: “Used added”
category: “success”
}).then(function(response) {
console.log(response);
}).catch(function(response) {
console.log(response);
});
| { “message”: “Indicator displayed” } | { “message”: “message is not passed from the widget” }
//Success response will be received when the user clicks the action button.
|
SDP.hideIndicator(indicator_type)
Hides the displayed indicator.
Parameters:
Name
| Type
| Description
|
indicator_type
| String
| Defines the type of indicator to be hidden. If indicator_type is not passed, indicators or any indicator_type will be hidden.
Possible indicator_types: message/loading.
|
Returns:
Promise - Resolved with Success or Rejected with Failure.
Syntax:
- SDP.hideIndicator(indicator_type).then(function(response) {
- console.log(response);
- }).catch(function(response) {
- console.log(response);
- });
Sample:
API Call
| Success Response
| Failure Response
|
SDP.hideIndicator({
indicator_type: “message”
}).then(function(response) {
console.log(response);
}).catch(function(response) {
console.log(response);
});
| { “message”: “Indicator hidden } | { “message”: indicator_type is not valid” } |
SDP.showAlert(options)
Displays an alert box when an action is performed in the widget.
Parameters:
Name
| Type
| Description
|
options*
| Object
| Object which contains API details.
Property
| Type
| Description
| title
| String
| Defines the title of the alert box. Default title - “Alert”.
| message*
| String
| The message or information to be displayed in the alert box.
| action
| String
| Defines the action button text. Default text - “Ok”.
|
|
* - Mandatory parameter
Returns:
Promise - Resolved with Success or Rejected with Failure. Success response will be received when the user clicks the action button.
Syntax:
- SDP.showAlert(options).then(function(response) {
- console.log(response);
- }).catch(function(response) {
- console.log(response);
- });
Sample:
API Call
| Success Response
| Failure Response
|
SDP.showAlert({
title: “Connection Info”,
message: “Win2 connection has been selected.”,
action: “Ok
}).then(function(response) {
console.log(response);
}).catch(function(response) {
console.log(response);
});
| { “index: “0” } | { “message”: “message cannot be null” } |
SDP.showConfirm(options)
Displays a confirm dialog box when an action is performed in the widget.
Parameters:
Name
| Type
| Description
|
options*
| Object
| Object which contains API details.
Property
| Type
| Description
| title
| String
| Defines the title of the confirm dialog. Default title - “Alert”.
| message*
| String
| The message or information to be displayed in the confirm dialog.
| mode
| String
| Mode is used to change the style of the alert box.
Supported mode: attention.
Attention mode is mainly used to render warnings and alert themes.
| confirm
| Array
| Renders the passed string as action buttons - Confirm and Cancel. The buttons will be rendered in RTL order. The primary action button will be styled according to the current application theme.
If 'confirm' property is not passed,
- The default “Yes” and “No” text will be rendered for the action buttons.
- If attention mode is passed, “Confirm” and “Cancel” will be rendered in the warning theme.
|
|
* - Mandatory parameter
Returns:
Promise - Resolved with Success or Rejected with Failure. Success response will be received when the user clicks the action button and contains the index of the action button.
Syntax:
- SDP.showConfirm(options).then(function(response) {
- console.log(response);
- }).catch(function(response) {
- console.log(response);
- });
Sample:
API Call
| Success Response
| Failure Response
|
SDP.showConfirm({
title: “Delete User”,
message: “Do you want to delete selected requester(s)?”,
confirm: [“Delete”, “Cancel”]
}).then(function(response) {
console.log(response);
}).catch(function(response) {
console.log(response);
});
| { “index: “0” } | { “message”: “message cannot be null” } |