This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Companies in FreshDesk
Overview
The following operations allow you to work with companies. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with companies, see Sample configuration.
Operation | Description |
---|---|
Creates a new company. | |
getCompany | Retrieves a particular company. |
listCompanies | Retrieves a list of companies. |
updateCompany | Updates a particular company. |
deleteCompany | Deletes a particular company. |
listCompanyFields | List all fields of company. |
Operation details
This section provides further details on the operations related to companies.
Creates a new company
The createCompany operation creates a new company.
<freshdesk.createCompany> <name>{$ctx:name}</name> <description>{$ctx:description}</description> <domains>{$ctx:domains}</domains> <note>{$ctx:note}</note> <customFields>{$ctx:customFields}</customFields> </freshdesk.createCompany>
Properties
name:
description:
note: Any specific note about the company.
customFields: Key value pairs containing the names and values of custom fields.
domains:Domains of the company.
Sample request
Following is a sample REST/JSON request that can be handled by the createCompany operation.
{ "apiUrl": "https://wso2yasho.freshdesk.com", "apiKey": "SODsQllHr0NicsiRpRWw", "apiVersion": "v2", "name":"companyName", "description":"Description of Company", "note":"companyNote", "domains":"["test1domain","test2domain"], "customFields": { "a": "testa" } }
Retrieving a company
The
operation retrieves details of a specific company.getCompany
<freshdesk.getCompany> <companyId>{$ctx:companyId}</companyId> </freshdesk.getCompany>
Properties
companyId:
Sample request
Following is a sample REST/JSON request that can be handled by the
getCompany
operation.
{ "apiUrl": "https://wso2yasho.freshdesk.com", "apiKey": "SODsQllHr0NicsiRpRWw", "apiVersion": "v2", "companyId":"19000007803" }
Retrieves a list of companies.
The listCompanies operation retrieves a list of companies.
<freshdesk.listCompanies/>
Sample request
Following is a sample REST/JSON request that can be handled by the listCompanies operation.
{ "apiUrl": "https://wso2yasho.freshdesk.com", "apiKey": "SODsQllHr0NicsiRpRWw", "apiVersion": "v2" }
Updates a particular company
The updateCompany operation updates a particular company.
<freshdesk.updateCompany> <companyId>{$ctx:companyId}</companyId> <name>{$ctx:name}</name> <description>{$ctx:description}</description> <domains>{$ctx:domains}</domains> <note>{$ctx:note}</note> <customFields>{$ctx:customFields}</customFields> </freshdesk.updateCompany>
Properties
name:
description:
note: Any specific note about the company.
customFields: Key value pairs containing the names and values of custom fields.
domains:Domains of the company.
Sample request
Following is a sample REST/JSON request that can be handled by the updateCompany operation.
{ "apiUrl": "https://wso2yasho.freshdesk.com", "apiKey": "SODsQllHr0NicsiRpRWw", "apiVersion": "v2", "companyId":"19000007803", "name":"companyNameUpdates", "description":"Description of Company Update", "note":"companyNoteUpdate", "domains":"["test1domain","test2domain"], "customFields": { "a": "testa" } }
Deletes a particular company
The deleteCompany operation deletes a particular company.
<freshdesk.deleteCompany> <companyId>{$ctx:companyId}</companyId> </freshdesk.deleteCompany>
Properties
Sample request
Following is a sample REST/JSON request that can be handled by the deleteCompany operation.
{ "apiUrl": "https://wso2yasho.freshdesk.com", "apiKey": "SODsQllHr0NicsiRpRWw", "apiVersion": "v2", "companyId":"19000007803" }
List all fields of company
The listCompanyFields operation lists all fields of company.
<freshdesk.listCompanyFields/>
Sample request
Following is a sample REST/JSON request that can be handled by the deleteCompany operation.
{ "apiUrl": "https://wso2yasho.freshdesk.com", "apiKey": "SODsQllHr0NicsiRpRWw", "apiVersion": "v2" }
Sample configuration
Following is a sample proxy service that illustrates how to connect to FreshDesk with the init
operation and use the createCompany operation. The sample request for this proxy can be found in the createCompany sample request.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="freshdesk_createCompany" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="apiKey" expression="json-eval($.apiKey)"/> <property name="apiVersion" expression="json-eval($.apiVersion)"/> <property name="name" expression="json-eval($.name)"/> <property name="description" expression="json-eval($.description)"/> <property name="domains" expression="json-eval($.domains)"/> <property name="note" expression="json-eval($.note)"/> <property name="customFields" expression="json-eval($.customFields)"/> <freshdesk.init> <apiKey>{$ctx:apiKey}</apiKey> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiVersion>{$ctx:apiVersion}</apiVersion> </freshdesk.init> <freshdesk.createCompany> <name>{$ctx:name}</name> <description>{$ctx:description}</description> <domains>{$ctx:domains}</domains> <note>{$ctx:note}</note> <customFields>{$ctx:customFields}</customFields> </freshdesk.createCompany> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>