Interface API

Interface APIs are used to trigger user interface events on a page. For example, you can open add manual call log page after a phone call.

Global Interface APIs
The following APIs are available to all apps:

Show Modal - Opens a Modal dialog box in an IFrame to display HTML content to users.

Note:
Events API and Interface API are not allowed within the Modal IFrame.


template.html

Copied Copy
1
client.interface.trigger("showModal", {title: "Sample Modal", template: "modal.html"})

If your app includes services, such as Data API and Request API, you need to include the following Freshclient link within the Modal IFrame.

modal.html

Copied Copy
1
<script src="http://static.freshdev.io/fdk/2.0/assets/fresh_client.js"></script>

Show Confirm - Displays a confirmation dialog with title and message to users. By default, the dialog shows the OK and Cancel buttons.

Note:
Maximum recommended character length for The Save and Cancel label is 20.


Sample confirmation dialog with default buttons

Copied Copy
1
2
client.interface.trigger("showConfirm", {title: "Sample Confirm", message: "Are you sure you want to close this deal?"}) /*"title" and "message" should be plain text.*/

Sample confirmation dialog with saveLabel and cancelLabel

Copied Copy
1
2
client.interface.trigger("showConfirm", {title: "Sample Confirm", message: "Do you want to save the changes?", saveLabel: "save", cancelLabel: "ignore"}) /*"title" and "message" should be plain text.*/

Show Notifications - Display notifications with type and message. Following are the different types of notifications that you can use:

Sample notification with message

Copied Copy
1
2
client.interface.trigger("showNotify", {type: "success", message: "sample notification"}) /*"title" and "message" should be plain text.*/

Open Create Lead - Opens the create lead dialog.

Copied Copy
1
client.interface.trigger("open", {id: "lead"});

Open Create Contact - Opens the create contact dialog.

Copied Copy
1
client.interface.trigger("open", {id: "contact"});

Open Create Account - Opens the create account dialog.

Copied Copy
1
client.interface.trigger("open", {id: "account"});

Open Create Deal - Opens the create deal dialog.

Copied Copy
1
client.interface.trigger("open", {id: "deal"});

Open Create Call Log - Opens the create call log dialog.

Copied Copy
1
client.interface.trigger("open", {id: "calllog"});

Show Lead - Is used to navigate to the Lead Details page.

Copied Copy
1
client.interface.trigger("show", {id: "lead",value:"1"});

Show Contact - Is used to navigate to the Contact Details page.

Copied Copy
1
client.interface.trigger("show", {id: "contact",value:"1"});

Show Account - Is used to navigate to the Account Details page.

Copied Copy
1
client.interface.trigger("show", {id: "account",value:"1"});

Show Deal - Is used to navigate to the Deal Details page.

Copied Copy
1
client.interface.trigger("show", {id: "deal",value:"1"});

Log in with your Freshsales account

Enter your helpdesk URL to proceed to login

Proceed

By clicking "Proceed", you agree to our Terms of Use.