Module zendesk.voice
ballerinax/zendesk.voice Ballerina library
Overview
This is a generated connector for Zendesk Talk API v2 OpenAPI specification. Zendesk Voice provides capability to work with talk agents, groups, and tickets.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create an Zendesk account.
- Obtain tokens - Follow this guide.
Quickstart
To use the Zendesk Voice connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
First, import the ballerinax/zendesk.voice module into the Ballerina project.
import ballerinax/zendesk.voice as zenvoice;
Step 2: Create a new connector instance
Create a zenvoice:ClientConfig with the username and password obtained, then initialize the connector with it and the service URL (Zendesk Support URL) according to the Zendesk Support documentation.
zenvoice:ClientConfig clientConfig = { auth: { username: <ZENDESK_EMAIL>, password: <ZENDESK_PASSWORD> } }; zenvoice:Client baseClient = check new Client(clientConfig, serviceUrl = "<https://{YOUR_SUBDOMAIN}.zendesk.comL>");
Step 3: Invoke connector operation
-
Now you can use the operations available within the connector. Note that they are in the form of remote operations.
Following is an example on how to list the phone numbers.
public function main() returns error? { zenvoice:PhoneNumbers phoneNumbers = check baseClient->listPhoneNumbers(); log:printInfo(phoneNumbers.toString()); } -
Use
bal runcommand to compile and run the Ballerina program.