### Create Ticket Example Source: https://supportcandy.net/docs/tickets This example demonstrates how to create a new ticket using the SupportCandy Tickets API. It includes common fields and shows how to incorporate custom fields. ```APIDOC ## POST /wp-json/supportcandy/v2/tickets ### Description Creates a new support ticket with specified details, including custom fields. ### Method POST ### Endpoint `/wp-json/supportcandy/v2/tickets` ### Parameters #### Request Body - **name** (string) - Required - The name of the ticket requester. - **email** (string) - Required - The email address of the ticket requester. - **subject** (string) - Required - The subject of the ticket. - **description** (string) - Optional - The detailed description of the ticket. - **description_attachments** (string) - Optional - Comma-separated list of attachment IDs for the description. - **category** (integer) - Optional - The ID of the ticket category. - **priority** (integer) - Optional - The ID of the ticket priority. - **assigned_agent** (string) - Optional - Comma-separated list of agent IDs to assign the ticket to. - **cust_<id>** (string/integer) - Optional - Custom fields, where <id> is the custom field slug. The type of value depends on the custom field type (e.g., string for textfield, integer for single-select dropdown, comma-separated string for multi-select dropdown). ### Request Example ```curl curl --location --request POST 'http://localhost/wp-json/supportcandy/v2/tickets' \ --header 'Authorization: Basic YWRtaW46MGk2dCBzMW51IG1uZEUgd1c4SSBST0x5IGRxdEU=' \ --form 'name="John Doe"' \ --form 'email="johndoe@test.com"' \ --form 'subject="This is test subject"' \ --form 'description="This is test description."' \ --form 'description_attachments="4,5"' \ --form 'category="2"' \ --form 'priority="3"' \ --form 'assigned_agent="1,2"' \ --form 'cust_31="test"' ``` ### Response #### Success Response (200) Details of the created ticket (schema not provided in source). #### Response Example (Response example not provided in source) ``` -------------------------------- ### Get Current User Details Source: https://supportcandy.net/docs/current-user Use this cURL command to make a GET request to the SupportCandy API to retrieve details of the current user. Ensure you include the necessary Authorization header. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/current-user' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### Get Custom Field Options Source: https://supportcandy.net/docs/custom-fields Fetch all available options for a custom field. This is applicable to fields where 'has_options' is true. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/custom-fields/40/options' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### Example Current User API Response Source: https://supportcandy.net/docs/current-user This is a sample JSON response from the current user API endpoint. It includes user identification like name and email, and detailed agent capabilities if the user is an agent. ```json {"name":"John Doe","email":"johndoe@test.com","is_agent":true,"agent_caps":{"view-unassigned":true,"view-assigned-me":true,"view-assigned-others":true,"reply-unassigned":true,"reply-assigned-me":true,"reply-assigned-others":true,"pn-unassigned":true,"pn-assigned-me":true,"pn-assigned-others":true,"aa-unassigned":true,"aa-assigned-me":true,"aa-assigned-others":true,"cs-unassigned":true,"cs-assigned-me":true,"cs-assigned-others":true,"ctf-unassigned":true,"ctf-assigned-me":true,"ctf-assigned-others":true,"caof-unassigned":true,"caof-assigned-me":true,"caof-assigned-others":true,"crb-unassigned":true,"crb-assigned-me":true,"crb-assigned-others":true,"eth-unassigned":true,"eth-assigned-me":true,"eth-assigned-others":true,"dth-unassigned":true,"dth-assigned-me":true,"dth-assigned-others":true,"vl-unassigned":true,"vl-assigned-me":true,"vl-assigned-others":true,"dtt-unassigned":true,"dtt-assigned-me":true,"dtt-assigned-others":true,"ar-unassigned":true,"ar-assigned-me":true,"ar-assigned-others":true,"backend-access":true,"create-as":true,"dtt-access":true,"eci-access":true}} ``` -------------------------------- ### Get Single Priority by ID Source: https://supportcandy.net/docs/priorities Use this endpoint to retrieve details for a specific priority by providing its unique ID. Requires an Authorization header. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/priorities/1' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### Get custom field options Source: https://supportcandy.net/docs/custom-fields This API helps you to list all options for a given custom field. ```APIDOC ## GET /wp-json/supportcandy/v2/custom-fields//options ### Description This API helps you to list options for the custom field. Custom field API response includes the field `has_options` which you can use to determine whether this custom field has options or not. ### Method GET ### Endpoint /wp-json/supportcandy/v2/custom-fields//options ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the custom field whose options are to be retrieved. ### Request Example ```curl curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/custom-fields/40/options' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### Get Single Custom Field Source: https://supportcandy.net/docs/custom-fields Retrieve details for a specific custom field by providing its ID. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/custom-fields/2' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### Get Single Category by ID Source: https://supportcandy.net/docs/categories Retrieve details for a specific category by providing its unique ID. An authorization header is required. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/categories/1' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### Get a single attachment by ID Source: https://supportcandy.net/docs/attachments Retrieve details for a specific attachment using its ID. Ensure the Authorization header is correctly set. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/attachments/23' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### Get Ticket List Items via API Source: https://supportcandy.net/docs/tickets This API endpoint returns a list of all fields that are allowed to be displayed in the ticket list view for the current user. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/tickets/list-items' \ --header 'Authorization: Basic YWRtaW46MGk2dCBzMW51IG1uZEUgd1c4SSBST0x5IGRxdEU=' ``` -------------------------------- ### List All Priorities Source: https://supportcandy.net/docs/priorities Use this endpoint to retrieve a list of all priorities configured in the system. Requires an Authorization header. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/priorities' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### Get single usergroup Source: https://supportcandy.net/docs/usergroups This API helps you to list a single usergroup. ```APIDOC ## GET /wp-json/supportcandy/v2/usergroups/ ### Description This API helps you to list a single usergroup. ### Method GET ### Endpoint /wp-json/supportcandy/v2/usergroups/ ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the usergroup to retrieve. ### Request Example ```curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/usergroups/1' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### List All Customers Source: https://supportcandy.net/docs/customers Use this endpoint to retrieve a list of all customers. You can paginate results and filter by a search string. Ensure you include the necessary Authorization header. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/customers?page=1&per_page=20&search=' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### List All Categories Source: https://supportcandy.net/docs/categories Use this endpoint to retrieve a list of all categories. Ensure you have the correct authorization header. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/categories' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### Get single category Source: https://supportcandy.net/docs/categories This API helps you to list a single category. ```APIDOC ## GET /wp-json/supportcandy/v2/categories/ ### Description This API helps you to list a single category. ### Method GET ### Endpoint /wp-json/supportcandy/v2/categories/ ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the category to retrieve. ### Request Example ```curl curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/categories/1' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### Get single rating Source: https://supportcandy.net/docs/ratings This API helps you to list a single rating. ```APIDOC ## GET /wp-json/supportcandy/v2/ratings/ ### Description This API helps you to list a single rating. ### Method GET ### Endpoint /wp-json/supportcandy/v2/ratings/ ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the rating to retrieve. ### Request Example ```curl curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/ratings/1' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### List All Statuses Source: https://supportcandy.net/docs/statuses Use this endpoint to retrieve a list of all available statuses. Ensure you include the necessary Authorization header. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/statuses' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### List All Usergroups Source: https://supportcandy.net/docs/usergroups Use this endpoint to retrieve a list of all available usergroups. Ensure you include the necessary Authorization header. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/usergroups' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### Get single status Source: https://supportcandy.net/docs/statuses This API helps you to list a single status. ```APIDOC ## GET /wp-json/supportcandy/v2/statuses/ ### Description This API helps you to list a single status. ### Method GET ### Endpoint /wp-json/supportcandy/v2/statuses/ ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the status to retrieve. ### Request Example ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/statuses/1' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### Get single ticket Source: https://supportcandy.net/docs/tickets This API helps you to retrieve a single ticket by its ID. ```APIDOC ## GET /wp-json/supportcandy/v2/tickets/ ### Description Retrieves a single ticket by its ID. ### Method GET ### Endpoint /wp-json/supportcandy/v2/tickets/ ### Request Example ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/tickets/1045' \ --header 'Authorization: Basic YWRtaW46MGk2dCBzMW51IG1uZEUgd1c4SSBST0x5IGRxdEU=' ``` ``` -------------------------------- ### List All Agents Source: https://supportcandy.net/docs/agents Use this endpoint to retrieve a list of all agents. You can paginate results and filter by a search string. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/agents?page=1&per_page=20&search=' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### Get single customer Source: https://supportcandy.net/docs/customers This API helps you to list a single customer by their ID. ```APIDOC ## GET /wp-json/supportcandy/v2/customers/ ### Description This API helps you to list a single customer by their ID. ### Method GET ### Endpoint /wp-json/supportcandy/v2/customers/ ### Request Example ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/customers/1' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### Get single priority Source: https://supportcandy.net/docs/priorities This API helps you to list a single priority by its ID. ```APIDOC ## GET /wp-json/supportcandy/v2/priorities/ ### Description This API helps you to list a single priority. ### Method GET ### Endpoint /wp-json/supportcandy/v2/priorities/ ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the priority to retrieve. ### Request Example ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/priorities/1' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### List All Custom Fields Source: https://supportcandy.net/docs/custom-fields Use this endpoint to retrieve a list of all custom fields. You can paginate results and filter by field type. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/custom-fields?page=1&per_page=20&filter=all' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` -------------------------------- ### List all priorities Source: https://supportcandy.net/docs/priorities This API helps you to list all priorities. ```APIDOC ## GET /wp-json/supportcandy/v2/priorities ### Description This API helps you to list all priorities. ### Method GET ### Endpoint /wp-json/supportcandy/v2/priorities ### Request Example ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/priorities' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### Get single agent Source: https://supportcandy.net/docs/agents This API helps you to list a single agent by their ID. ```APIDOC ## GET /wp-json/supportcandy/v2/agents/ ### Description This API helps you to list a single agent by their ID. ### Method GET ### Endpoint /wp-json/supportcandy/v2/agents/ ### Request Example `curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/agents/1' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI='` ``` -------------------------------- ### Get Single Attachment Source: https://supportcandy.net/docs/attachments Retrieve details for a single attachment using its ID. ```APIDOC ## GET /wp-json/supportcandy/v2/attachments/ ### Description This API helps you to list a single attachment. ### Method GET ### Endpoint /wp-json/supportcandy/v2/attachments/ ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the attachment to retrieve. ### Request Example ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/attachments/23' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### Get single custom field Source: https://supportcandy.net/docs/custom-fields This API helps you to list a single custom field by its ID. ```APIDOC ## GET /wp-json/supportcandy/v2/custom-fields/ ### Description This API helps you to list a single custom field by its ID. ### Method GET ### Endpoint /wp-json/supportcandy/v2/custom-fields/ ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the custom field to retrieve. ### Request Example ```curl curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/custom-fields/2' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### List All Tickets Source: https://supportcandy.net/docs/tickets Use this endpoint to retrieve a list of all tickets you are authorized to view. You can filter, sort, and paginate the results using the available parameters. ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/tickets?page=1&per_page=20&filter=all&orderby=date_updated&order=DESC' \ --header 'Authorization: Basic YWRtaW46MGk2dCBzMW51IG1uZEUgd1c4SSBST0x5IGRxdEU=' ``` -------------------------------- ### List all customers Source: https://supportcandy.net/docs/customers This API helps you to list all customers. It supports pagination and searching. ```APIDOC ## GET /wp-json/supportcandy/v2/customers ### Description This API helps you to list all customers. It supports pagination and searching. ### Method GET ### Endpoint /wp-json/supportcandy/v2/customers ### Parameters #### Query Parameters - **page** (integer) - Optional - Current page of the collection. Default is `1`. - **per_page** (integer) - Optional - Maximum number of items to be returned in result set. Default is `20`. - **search** (string) - Optional - Limit results to those matching a string. ### Request Example ```bash curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/customers?page=1&per_page=20&search=' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### Get single option Source: https://supportcandy.net/docs/custom-fields This API helps you to list a single option for a given custom field. ```APIDOC ## GET /wp-json/supportcandy/v2/custom-fields//options/ ### Description This API helps you to list a single custom field option. ### Method GET ### Endpoint /wp-json/supportcandy/v2/custom-fields//options/ ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the custom field. - **option_id** (integer) - Required - The ID of the option to retrieve. ### Request Example ```curl curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/custom-fields/29/options/1' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ``` -------------------------------- ### List all categories Source: https://supportcandy.net/docs/categories This API helps you to list all categories. ```APIDOC ## GET /wp-json/supportcandy/v2/categories ### Description This API helps you to list all categories. ### Method GET ### Endpoint /wp-json/supportcandy/v2/categories ### Request Example ```curl curl --location --request GET 'http://localhost/wp-json/supportcandy/v2/categories' \ --header 'Authorization: Basic YWRtaW46bjVJWSBYc3pUIGlxN3MgSHhKWCA3YVdBIDlOblI=' ``` ```