How to Create a Ticket Using BoldDesk API
Creating tickets programmatically using BoldDesk API provides a seamless way to integrate ticket management into your workflows. This guide explains how to authenticate API requests, structure ticket creation requests, and handle responses.
Prerequisites
API Key: Ensure you have a valid API key generated from your BoldDesk account. Refer to the article for steps to generate an API key.How to Generate a BoldDesk API Key?
Steps to Create a Ticket
1. Authenticate API Request
BoldDesk API uses API key-based authentication to ensure secure access. You can refer to this article for authentication details: - BoldDesk API Authentication. Add the API key to the request header as shown below:
curl -X GET “https://{your domain}/api/v1.0/tickets” -H “x-api-key: {API Key}”
- Replace
{your domain}
in the API request URL with your actual BoldDesk domain. - Replace
{API Key}
with your actual API key. - Ensure the API key has sufficient permissions to access the requested resource.
2. Structure the Ticket Creation Request
To create a ticket, send a POST request to the following endpoint:
https://{your domain}/api/v1.0/tickets
By default, the skipDependencyValidation parameter is set to ‘false’. To bypass field validation, set skipDependencyValidation to ‘true’. If you leave it as false, ensure that the mandatory fields are included in the request payload.
Example JSON payload with required fields:
{
"brandId": 1,
"subject": "Subject of the ticket",
"description": "Description of the ticket",
"priorityId": 1,
"isVisibleInCustomerPortal": true,
"requesterEmailId": "john@example.com"
}
You can also tailor the request by including the required fields according to your specific use case.
Key Parameters:
- brandId: The ID of the brand under which the ticket will be created.
- subject: The title or summary of the ticket.
- description: Detailed information about the issue or request.
- priorityId: The priority level of the ticket (e.g., 1 for low, 2 for medium, etc.).
- isVisibleInCustomerPortal: Boolean value indicating whether the ticket should be visible in the customer portal.
- requesterEmailId: The email address of the requester.
3. Send the Request
Use tools like curl
, Postman, or any HTTP client library to send the request. Example using curl
:
curl -X POST "https://{your domain}/api/v1.0/tickets?skipDependencyValidation=true" \
-H "Content-Type: application/json" \
-H "x-api-key: {API Key}" \
-d '{
"brandId": 1,
"subject": "Subject of the ticket",
"description": "Description of the ticket",
"priorityId": 1,
"isVisibleInCustomerPortal": true,
"requesterEmailId": "john@example.com"
}'
4. Handle the Response
If the API key is valid and the request is correctly structured, the server will return a success response containing the ticket details. Example response:
{
"ticketId": 12345,
"message": "Ticket created successfully."
}
In the event of errors, review the error message and verify that all parameters are correctly provided. Additionally, you may test the BoldDesk REST API using Swagger : How to Test the BoldDesk Rest API Using Swagger
Related articles
- Refer to BoldDesk API documentation for additional endpoints and advanced configurations. BoldDesk API Documentation