Directly Help Desk API
Access
All help desk APIs require a valid Directly API token. After connecting Directly to your helpdesk, you can request an API token or invalidate and replace an existing token by clicking "Generate new token" in the Helpdesk Integration tab of your Directly admin panel.
Pass the API token as a parameter as described below or in a request header parameter as follows:
ApiToken:YOUR-API-TOKEN
Endpoints
Save Question
Create a new question on Directly, associated with a specific help desk case/ticket ID.
Request
POST https://[subdomain].directly.com/helpDesk/saveQuestion
Note: subdomain will be provided by Directly.
Parameters
- text (required): detailed question description
- helpDeskId (required): unique ID of the case/ticket
- apiToken (required): Valid Directly API token. Not required if specified in header.
- fullname (required): Display name to show for customer. If not present, a display name will be parsed from the email address
- emailAddress (required): Question will be asked on behalf of customer with this email address
- subject (optional): question subject (subject extracted from the text if not specified)
- isEliteOnly (optional): with the value "on", the question will only be routed to elite experts
- questionCategory (optional): Name of a category of questions. These names and their associated settings must be negotiated with Directly separately.
- metadata (optional): Map of metadata (name/value pairs) associated with the question. It is included in help desk cases and available to Universal Connector actions. Information in the top-level map is displayed to experts. That in subordinate maps is not displayed to them.
- rewardCategory (deprecated): Replaced with
questionCategory.
Response
Status 200
{
"question": {
"id": 218312,
"url": "https://[subdomain].directly.com/p/subdomain-sample-question-detailed-description-218312",
"status": "0 answers",
"isEscalated": false,
"answers": []
}
}
Error
Status 500
Sample
curl https://[subdomain].directly.com/helpDesk/saveQuestion \ --header ApiToken:YOUR-API-TOKEN \ --data "text=sample question detailed description" \ --data emailAddress=user@example.com \ --data "fullname=Joe User" \ --data helpDeskId=123456789 \ --data "metadata[Operating+System]=iOS+8.1" \ --data "metadata[Browser]=Safari" \ --data "metadata[Account][Creation Date]=2016-06-06 11:34:00" \ --data "metadata[Account][Worth]=1000000"In this example, experts will see the operating system and browser information, but not the hidden account information.
Close Question
Immediately close the Question in Directly, associated with a specific help desk case/ticket ID.
Request
POST https://[subdomain].directly.com/helpDesk/closeQuestion
Note: subdomain will be provided by Directly.
Parameters
- helpDeskId (required): unique ID of the case/ticket
- apiToken (required): Valid Directly API token. Not required if specified in header.
Response
Status 200
{
"question": {
"id": 218312,
"url": "https://[subdomain].directly.com/p/subdomain-sample-question-detailed-description-218312",
"status": "CLOSED"
}
}
Error
Status 500
Sample
curl https://[subdomain].directly.com/helpDesk/closeQuestion \ --header ApiToken:YOUR-API-TOKEN \ --data helpDeskId=123456789