Happyfox API Manual
Happyfox API Manual
Technical Reference
Other company names mentioned in this manual are trademarks of their respective
companies. Mention of third-party products is for informational purposes only and
constitutes neither an endorsement nor recommendation. Tenmiles Technologies Pvt. Ltd.
assumes no responsibility with regard to the performance or use of these products.
Tenmiles Technologies Pvt Ltd, 1A, Jhaver plaza, Nungambakkam, Chennai 600007
HappyFox API - Technical Reference
Table of Contents
1 Getting Started.................................................................................................................... 5
1.1 Introduction.................................................................................................................. 5
1.2 Requirements...............................................................................................................5
1.3 Documentation Conventions....................................................................................... 5
2 Protocols, Data Formats and Mechanisms.........................................................................6
2.1 API Version.................................................................................................................. 6
2.2 Resource URIs............................................................................................................ 6
2.2.1 Base URI.............................................................................................................. 6
2.3 Request Methods.........................................................................................................6
2.4 Authentication.............................................................................................................. 7
2.5 Throttling...................................................................................................................... 7
2.6 Request Content Types............................................................................................... 7
2.7 Response Content Types............................................................................................ 8
2.8 Data Types...................................................................................................................8
2.9 NULL Values................................................................................................................ 8
2.10 Paginated Lists for Collection Resources..................................................................9
2.10.1 URL Parameters................................................................................................. 9
2.10.2 Paginated List - Response Data Structure.........................................................9
2.10.3 Page Info - Inner Data Structure........................................................................ 9
2.11 Data Validation Errors.............................................................................................. 10
2.11.1 Field Errors - Response Data Structure........................................................... 10
3 Resources And Operations............................................................................................... 11
3.1 Ticket Category - Resource....................................................................................... 11
3.1.1 Operations.......................................................................................................... 11
3.1.1.1 Reading All Categories................................................................................11
3.1.1.2 Reading One Category................................................................................11
3.1.2 Data Structures...................................................................................................11
3.1.2.1 Ticket Category - Response Data Structure...............................................11
3.2 Ticket Status - Resource............................................................................................12
3.2.1 Operations.......................................................................................................... 12
3.2.1.1 Reading All Statuses................................................................................... 12
3.2.1.2 Reading One Status....................................................................................12
3.2.2 Data Structures...................................................................................................12
3.2.2.1 Ticket Status - Response Data Structure....................................................12
3.3 Ticket Priority - Resource...........................................................................................13
3.3.1 Operations.......................................................................................................... 13
3.3.1.1 Reading All Priorities................................................................................... 13
3.3.1.2 Reading One Priority...................................................................................13
3.3.2 Data Structures...................................................................................................13
3.3.2.1 Ticket Priority - Response Data Structure...................................................13
3.4 Staff - Resource......................................................................................................... 14
3.4.1 Operations.......................................................................................................... 14
3.4.1.1 Reading All Staff..........................................................................................14
3.4.1.2 Reading One Staff By ID.............................................................................14
3.4.1.3 Reading One Staff By Email....................................................................... 14
3.4.2 Data Structures...................................................................................................14
3.4.2.1 Staff - Response Data Structure................................................................. 14
3.5 User - Resource.........................................................................................................15
3.5.1 Operations.......................................................................................................... 15
3.5.1.1 Reading All Users........................................................................................15
3.5.1.2 Reading One User By ID............................................................................ 15
3.5.1.3 Reading One User By Email....................................................................... 15
3.5.2 Data Structures...................................................................................................15
3.5.2.1 User - Response Data Structure.................................................................15
3.6 Ticket - Resource.......................................................................................................16
3.6.1 Operations.......................................................................................................... 16
3.6.1.1 Reading All Tickets......................................................................................16
3.6.1.2 Reading One Ticket.....................................................................................16
3.6.1.3 Create A Ticket............................................................................................ 16
3.6.1.4 Add A Staff Update...................................................................................... 16
3.6.1.5 Add A Staff Private Note..............................................................................17
3.6.1.6 Add A User Reply........................................................................................ 17
3.6.2 Data Structures...................................................................................................17
3.6.2.1 Ticket - Response Data Structure............................................................... 17
3.6.2.2 Ticket Update - Inner Data Structure.......................................................... 18
3.6.2.3 Ticket Update By - Inner Data Structure..................................................... 18
3.6.2.4 Ticket Message- Inner Data Structure........................................................ 19
3.6.2.5 Ticket Attachment - Inner Data Structure....................................................19
3.6.2.6 Ticket Status Change - Inner Data Structure.............................................. 19
3.6.2.7 Ticket Priority Change - Inner Data Structure............................................. 19
3.6.2.8 Ticket Assignee Change - Inner Data Structure..........................................20
3.6.2.9 Ticket Category Change - Inner Data Structure..........................................20
3.6.2.10 Ticket Due Date Change - Inner Data Structure....................................... 20
3.6.2.11 Create Ticket - Request Data Structure.................................................... 20
3.6.2.12 Create Ticket Using User Email & Name - Request Data Structure.........21
3.6.2.13 Add Staff Update - Request Data Structure..............................................21
3.6.2.14 Add Staff Private Note - Request Data Structure......................................22
3.6.2.15 Add User Reply - Request Data Structure................................................ 22
3.6.2.16 Attachments - File Upload Request.......................................................... 22
3.7 Custom Fields............................................................................................................ 24
3.7.1 Operations.......................................................................................................... 24
3.7.1.1 Reading All User Custom Fields................................................................. 24
3.7.1.2 Reading One User Custom Fields.............................................................. 24
3.7.1.3 Reading All Ticket Custom Fields............................................................... 24
3.7.1.4 Reading One Ticket Custom Field.............................................................. 24
3.7.2 Types.................................................................................................................. 24
3.7.2.1 Custom Field Types.................................................................................... 24
3.7.2.2 Custom Field Choice Types........................................................................ 25
3.7.3 Data Structures...................................................................................................25
3.7.3.1 User Custom Field – Response Data Structure..........................................25
3.7.3.2 Ticket Custom Field - Response Data Structure.........................................25
3.7.3.3 Ticket Custom Fields To Category - Inner Data Structure..........................26
3.7.3.4 Choice Item - Inner Data Structure............................................................. 26
3.7.3.5 Multiple Choice Item - Inner Data Structure................................................26
3.7.3.6 Custom Field Value - Inner Data Structure................................................. 27
3.7.4 Notes.................................................................................................................. 27
3.7.4.1 Common Information For Setting Ticket / User Custom Field Values........27
3.7.4.2 Ticket Custom Field Values For Create Ticket............................................27
3.7.4.3 User Custom Field Values For Create Ticket..............................................28
1 Getting Started
1.1 Introduction
The API provided by the Helpdesk is a RESTful web service. It supports operations like
creating a ticket, adding updates to a ticket, listing tickets and users of the Helpdesk, etc. It
supports JSON, YAML, XML, Form Urlencoded and Multipart Form Data formats.
1.2 Requirements
The API requires following skills in any programming language
1. Making HTTP requests (using GET and POST HTTP methods as a minimum
requirement).
3. Generating and reading data in any one of the formats - JSON, YAML or XML
For example: if the parameter is <email> it should be replaced with the required
email address
2 Protocols, Data Formats and Mechanisms
This section of the document describes the communication protocol, data formats and
application mechanisms used in the API.
NOTE: not all resources support all the listed operations, see the documentation of each
resource for the supported methods
2.4 Authentication
The API requires a "API Key" and "Auth Code" pair for access. Contact the Helpdesk
Admin for access details.
The server uses HTTP Basic Authentication with the "API Key" as username and "Auth
Code" as the password. The authentication realm is "API".
The API server returns HTTP response code 401 in case of authorization required or login
failure.
SECURITY NOTES:
2. It is not recommended to invoke the API directly from browser using Javascript as
this would require the "API Key" and "Auth Code" to be present on the browser
side. Instead the API should be invoked from the web application server.
2.5 Throttling
The API server limits the number of requests that can be sent during a interval of time.
There are independent limits for read and write operations. Contact the Helpdesk Admin to
know the current limits and for changing them to meet requirements.
In case the request limits are exceeded the API server returns HTTP response code 503
along with the time to wait before retrying in the response body.
Any of the data formats can be used provided the correct Content-Type is set in the HTTP
request header.
NOTE: file uploads are only supported with Multipart Form Data.
Type Description
String String type with Unicode support
Integer Signed 64 bit integral number
ID Special type of Integer with minimum value 1, Will be unique within
each resource type
Float Floating point number
Boolean True/False type
DateTime Combined date and time in the ISO 8601 extended format of YYYY-
MM-DD HH:MM:SS.ssssss
NOTES:
1) all DateTime values in the API are in UTC timezone
2) the decimal part represented by ssssss is optional
3) a space separator is used between the date and time values
Date Date in the ISO 8601 extended format of YYYY-MM-DD
NOTE: all Date values in the API are in UTC timezone
By specifying a page size (lesser than or equal to the upper limit) and a corresponding
page number as URL parameters, the collection can be split the into a smaller number of
elements and progressively retrieved from the API server.
The response from the API server contains information about the page split and the actual
data as described below.
The error information response data is a List of Field Errors that contains information about
data validation errors in individual fields as well as any errors that apply to the entire
request (like errors that are not dependent on individual fields).
3.1.1 Operations
3.2.1 Operations
3.3.1 Operations
3.4.1 Operations
URL <base_uri>/<response_format>/staff/
HTTP Method GET
Response Data List of Staff
URL <base_uri>/<response_format>/staff/<id>/
HTTP Method GET
Response Data Staff
URL <base_uri>/<response_format>/staff/<email>/
HTTP Method GET
Response Data Staff
3.5.1 Operations
URL <base_uri>/<response_format>/user/<id>/
HTTP Method GET
Response Data User
URL <base_uri>/<response_format>/user/<email>/
HTTP Method GET
Response Data User
3.6.1 Operations
NOTE: file attachments are supported only when using Multipart Form Data
URL <base_uri>/<response_format>/tickets/
HTTP Method POST
Request Data Create Ticket or Create Ticket Using User Email & Name
Response Data Ticket
NOTE: file attachments are supported only when using Multipart Form Data
URL <base_uri>/<response_format>/ticket/<id>/staff_update/
HTTP Method POST
Request Data Add Staff Update
Response Data Ticket
3.6.1.5 Add A Staff Private Note
To add a staff private note make a POST request to the URL below with request data
encoded in one of the supported formats. On success it returns the modified ticket.
URL <base_uri>/<response_format>/ticket/<id>/staff_pvtnote/
HTTP Method POST
Request Data Add Staff Private Note
Response Data Ticket
NOTE: file attachments are supported only when using Multipart Form Data
URL <base_uri>/<response_format>/ticket/<id>/user_reply/
HTTP Method POST
Request Data Add User Reply
Response Data Ticket
NOTE: Any custom fields required for the ticket need to be appended to the list below. See
3.6.2.12 Create Ticket Using User Email & Name - Request Data
Structure
This data structure contains information required to create a ticket. This variation uses the
email and name of a user. If the email already exists in the Helpdesk, the corresponding
user is used, else a new user is created.
NOTE: Any custom fields required for the ticket and user need to be appended to the list
below. See Ticket Custom Field Values For Create Ticket and User Custom Field Values
For Create Ticket for information.
File uploads are only supported with Multipart Form Data format. To upload a file, construct
the request as documented at http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2
(check if library functions are available in your programming languages to prepare
Multipart Form Data requests)
3.7.1 Operations
3.7.2 Types
3.7.4 Notes
2. Values for "multiple_choice" type custom fields should be sent as multiple fields with
the same field name when using Form Urlencoded and Multipart Form Data
formats. The values can be sent as List for JSON and YAML formats.
2. The values for ticket custom fields should be appended to the fields for Create
Ticket
3. The value for a ticket custom field should be sent using a field name constructed
from the ID of the ticket custom field in the following format "t-cf-<id>"
4. The ticket custom fields applicable to a ticket are dependent on the ticket's
category. This can be determined from the "categories" field of Ticket Custom Field
3.7.4.3 User Custom Field Values For Create Ticket
1. All the points in Common Information For Setting Ticket / User Custom Field Values
2. The values for user custom fields should be appended to the fields for Create Ticket
3. The value for a user custom fields should be sent using a field name constructed
from the ID of the user custom field in the following format "c-cf-<id>"