### Application Installation Object Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ApplicationInstallations.md Represents a single application installation on a device within Freshservice. It includes details about the installation itself, the device, and associated user and department information. ```APIDOC ## Application Installation Object ### Description Represents a single application installation on a device within Freshservice. It includes details about the installation itself, the device, and associated user and department information. ### Properties - **id** (Number) - Optional, Readonly - Unique identifier of the Installation. - **installation_machine_id** (Number) - Optional - ID (asset_display_id) of the device where the software is installed. - **version** (Number) - Optional - Version of the application installed in the device. - **user_id** (Number) - Optional - ID of the user who uses the device where the application is installed in. - **department_id** (Number) - Optional - ID of the department/company of the device where the application is installed in. - **installation_date** (Date) - Optional - Date when the application was installed. - **installation_path** (String) - Optional - The installation path of the application. - **created_time** (Date) - Optional, Readonly - Timestamp at which the application installation was created. - **updated_time** (Date) - Optional, Readonly - Timestamp at which the application installation was last modified. ``` -------------------------------- ### Install Freshworks API SDK Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/README.md Install the SDK using npm. This is the first step to using the SDK in your Node.js project. ```sh npm install --save @freshworks/api-sdk ``` -------------------------------- ### List Application Installations Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ApplicationsApi.md Get a list of all devices where a specific software application is installed. Requires the application ID and the initialized SDK. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.ApplicationsApi(); let application_id = 56; // Number | apiInstance.listApplicationInstallations(application_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### listApplicationInstallations Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ApplicationsApi.md List all devices where a specific software application is installed. ```APIDOC ## GET /api/v2/applications/{application_id}/installations ### Description List all devices where the software is installed in ### Method GET ### Endpoint /api/v2/applications/{application_id}/installations ### Parameters #### Path Parameters - **application_id** (Number) - Required - Description of the application ID ### Response #### Success Response (200) - **ListApplicationInstallations200Response** - Description of the response object ### Request Example ```javascript let apiInstance = new FreshserviceApiSdkCodegen.ApplicationsApi(); let application_id = 56; apiInstance.listApplicationInstallations(application_id).then(data => { console.log(data); }, error => { console.error(error); }); ``` ``` -------------------------------- ### GET /api/v2/assets/{display_id}/applications Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/AssetsApi.md List all software installed in the device. ```APIDOC ## GET /api/v2/assets/{display_id}/applications ### Description List all software installed in the device. ### Method GET ### Endpoint /api/v2/assets/{display_id}/applications ### Parameters #### Path Parameters - **display_id** (String) - Required - The display ID of the asset. ### Authorization No authorization required ``` -------------------------------- ### ListApplicationInstallations200Response Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ListApplicationInstallations200Response.md The response object for the List Application Installations API call. ```APIDOC ## ListApplicationInstallations200Response ### Description This object represents the successful response when listing application installations. ### Properties #### application (ApplicationInstallations) - **application** (ApplicationInstallations) - Optional - Contains details about the application installations. ``` -------------------------------- ### listAssetApplications Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/AssetsApi.md Lists all software applications installed in a device, identified by its display ID. ```APIDOC ## listAssetApplications ### Description Lists all software applications installed in a device. ### Method GET ### Endpoint /api/v2/assets/{display_id}/applications ### Parameters #### Path Parameters - **display_id** (Number) - Required - The display ID of the asset. ### Return type [ListAssetApplications200Response](ListAssetApplications200Response.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### Create Asset Example Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/AssetsApi.md Demonstrates how to create a new asset using the Freshservice API SDK. Ensure the SDK is imported and an instance of AssetsApi is initialized. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.AssetsApi(); let Asset = new FreshserviceApiSdkCodegen.Asset(); // Asset | apiInstance.createAsset(Asset).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Create Release Task Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ReleasesApi.md This code example demonstrates how to create a new task for a given release. Provide the release ID and a Task object. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.ReleasesApi(); let task = new FreshserviceApiSdkCodegen.Task(); // Task | detailss of task to be created let release_id = 789; // Number | ID of release for which tasks are to be retrieved apiInstance.createReleaseTask(task, release_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### GET /api/v2/assets Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/AssetsApi.md List all assets in Freshservice. ```APIDOC ## GET /api/v2/assets ### Description List all assets in Freshservice. ### Method GET ### Endpoint /api/v2/assets ### Authorization No authorization required ``` -------------------------------- ### GET /api/v2/assets/{display_id}/components Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/AssetsApi.md List all components of the device. ```APIDOC ## GET /api/v2/assets/{display_id}/components ### Description List all components of the device. ### Method GET ### Endpoint /api/v2/assets/{display_id}/components ### Parameters #### Path Parameters - **display_id** (String) - Required - The display ID of the asset. ### Authorization No authorization required ``` -------------------------------- ### GET /api/v2/projects Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ProjectsApi.md List all Projects in Freshservice. Supports filtering and pagination. ```APIDOC ## GET /api/v2/projects ### Description List all Projects in Freshservice. ### Method GET ### Endpoint /api/v2/projects ### Parameters #### Query Parameters - **(Query Parameters)** - Supports filtering and pagination. (Specific parameters not detailed in source) ### Response #### Success Response (200) - **(Response Body)** - A list of projects. (Type not specified in source) ### Response Example ```json // Example response structure (actual response may vary) { "projects": [ { "id": 123, "name": "Project Alpha", "status": "open" }, { "id": 124, "name": "Project Beta", "status": "closed" } ] } ``` ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### Get Project Details Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ProjectsApi.md Retrieve the details of a specific project using its ID. The response includes project information. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.ProjectsApi(); let project_id = 789; // Number | ID of project to retrieve apiInstance.getProject(project_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Get a Specific Product Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ProductsApi.md Retrieve details for a specific product using its ID. The response will contain the product's information. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.ProductsApi(); let product_id = 56; // Number | apiInstance.getProduct(product_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Create Ticket Task in JavaScript Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/TicketsApi.md This example demonstrates how to create a new task on a Freshservice ticket. It requires the SDK to be imported and a TicketsApi instance initialized. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.TicketsApi(); let task = new FreshserviceApiSdkCodegen.Task(); // Task | details of task to be created let ticket_id = 789; // Number | ID of ticket request for which tasks are to be retrieved apiInstance.createTicketTask(task, ticket_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Build and Serve Documentation Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/contributing/how-to-support-new-spec.md Commands to build the TypeDoc documentation and run the VuePress development server to preview the documentation site, including newly added product API documentation. ```sh # Build typedoc documents npm run-script build:docs # Run Dev server to launch vuepress site npm run-script docs:dev ``` -------------------------------- ### Build Documentation and Run Dev Server Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/contributing/how-to-update-spec.md Commands to build typedoc documents and launch the VuePress development server. ```sh # Build typedoc documents npm run-script build:docs ``` ```sh # Run Dev server to launch vuepress site npm run-script docs:dev ``` -------------------------------- ### Initialize Freshservice API SDK Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/freshservice/README.md Import and create a new instance of the Freshservice API SDK. Ensure you provide your Freshservice domain and API key. ```javascript // import Freshservice API-SDK const { Freshservice } = require("@freshworks/api-sdk"); // Define access credentials - Recommended to pass them externally const domain = "********.freshservice.com"; const apiKey = "************"; // Create new Freshservice instance const fs = new Freshservice(domain, apiKey); ``` -------------------------------- ### Build Project and Client Libraries Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/contributing/how-to-support-new-spec.md Commands to build the entire project or specifically the client libraries after adding a new product's subdirectory and updating typedoc.json. ```sh # Build entire project npm run-script build # Build client libraries alone npm run-script build:client ``` -------------------------------- ### Get Applicant by ID Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/freshteam/applicants.md Retrieves a specific applicant's details using their unique ID. The response object needs to be accessed using `.json()` to get the applicant data. ```javascript const applicant = await ft.applicants.get(id); // use applicant.json() to access objects ``` -------------------------------- ### GET /api/v2/component_types Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/AssetsApi.md List all component types. ```APIDOC ## GET /api/v2/component_types ### Description List all component types. ### Method GET ### Endpoint /api/v2/component_types ### Authorization No authorization required ``` -------------------------------- ### Build Project and Client Libraries Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/contributing/how-to-update-spec.md Commands to build the entire project or just the client libraries. ```sh # Build entire project npm run-script build ``` ```sh # Build client libraries alone npm run-script build:client ``` -------------------------------- ### GET /api/v2/assets/{display_id} Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/AssetsApi.md Retrieve a specific asset. ```APIDOC ## GET /api/v2/assets/{display_id} ### Description Retrieve a specific asset. ### Method GET ### Endpoint /api/v2/assets/{display_id} ### Parameters #### Path Parameters - **display_id** (String) - Required - The display ID of the asset to retrieve. ### Authorization No authorization required ``` -------------------------------- ### listOnboardingRequests Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/EmployeeOnboardingApi.md Fetches a list of all Onboarding Requests for a particular user. This method does not require any parameters. ```APIDOC ## listOnboardingRequests ### Description Get all Onboarding Requests for a particular user. ### Method GET ### Endpoint /api/v2/onboarding/requests ### Parameters This endpoint does not need any parameter. ### Return type [**OnboardingRequestIndex**](OnboardingRequestIndex.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### List All Onboarding Requests Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/EmployeeOnboardingApi.md Retrieves all onboarding requests for a particular user. This method does not require any parameters. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.EmployeeOnboardingApi(); apiInstance.listOnboardingRequests().then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Create Asset Component Example Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/AssetsApi.md Shows how to add a new component to an existing asset by providing the asset's display ID. This operation requires an initialized AssetsApi instance. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.AssetsApi(); let display_id = 56; // Number | apiInstance.createAssetComponent(display_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### GET /api/v2/assets/{display_id}/requests Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/AssetsApi.md List all requests associated to the asset. ```APIDOC ## GET /api/v2/assets/{display_id}/requests ### Description List all requests associated to the asset. ### Method GET ### Endpoint /api/v2/assets/{display_id}/requests ### Parameters #### Path Parameters - **display_id** (String) - Required - The display ID of the asset. ### Authorization No authorization required ``` -------------------------------- ### GET /api/v2/assets/{display_id}/contracts Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/AssetsApi.md List all contracts associated to the asset. ```APIDOC ## GET /api/v2/assets/{display_id}/contracts ### Description List all contracts associated to the asset. ### Method GET ### Endpoint /api/v2/assets/{display_id}/contracts ### Parameters #### Path Parameters - **display_id** (String) - Required - The display ID of the asset. ### Authorization No authorization required ``` -------------------------------- ### Create a Product Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ProductsApi.md Use this method to create a new product in the Product Catalog. Ensure the Product object is correctly instantiated. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.ProductsApi(); let product = new FreshserviceApiSdkCodegen.Product(); // Product | apiInstance.createProduct(product).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### listOnboardingRequests Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/EmployeeOnboardingApi.md Retrieves a list of all Onboarding Requests within Freshservice. ```APIDOC ## GET /api/v2/onboarding_requests ### Description Get all Onboarding Requests. ### Method GET ### Endpoint /api/v2/onboarding_requests ### Parameters #### Query Parameters * **filter** (string) - Optional - Filter results based on specific criteria. * **sort_by** (string) - Optional - Sort results by a specific field. * **order** (string) - Optional - Order of sorting (ASC or DESC). * **page** (integer) - Optional - Page number for pagination. * **per_page** (integer) - Optional - Number of results per page. ### Response #### Success Response (200) - **data** (Array) - A list of all onboarding requests. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Get applicant by ID Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/freshteam/applicants.md Retrieves a specific applicant by their unique ID. ```APIDOC ## Get applicant by ID ### Description Retrieves a specific applicant by their unique ID. ### Method GET ### Endpoint /applicants/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the applicant. ### Response #### Success Response (200) - A `Freshteam.models.ApplicantDetail` object. ``` -------------------------------- ### BusinessHoursServiceDeskHoursMonday Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/BusinessHoursServiceDeskHoursMonday.md Represents the business hours for Monday, specifying the start and end of the workday. ```APIDOC ## BusinessHoursServiceDeskHoursMonday ### Description Defines the start and end times for the workday on Monday. ### Properties #### Request Body - **beginning_of_workday** (String) - Optional - Start time for the day in the ISO 8601 hh:mm format. - **end_of_workday** (String) - Optional - End time for the day in the ISO 8601 hh:mm format. ### Request Example ```json { "beginning_of_workday": "09:00", "end_of_workday": "18:00" } ``` ### Response #### Success Response (200) - **beginning_of_workday** (String) - Start time for the day in the ISO 8601 hh:mm format. - **end_of_workday** (String) - End time for the day in the ISO 8601 hh:mm format. #### Response Example ```json { "beginning_of_workday": "09:00", "end_of_workday": "18:00" } ``` ``` -------------------------------- ### Create Solution Folder Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/SolutionArticlesApi.md This code creates a new solution folder in Freshservice. It requires a SolutionFolder object as input. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.SolutionArticlesApi(); let solution_folder = new FreshserviceApiSdkCodegen.SolutionFolder(); // SolutionFolder | Folder that needs to be created apiInstance.createSolutionFolder(solution_folder).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### GET /api/v2/projects/{project_id} Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ProjectsApi.md View details of a specific Project. Requires the project ID. ```APIDOC ## GET /api/v2/projects/{project_id} ### Description View Project details in Freshservice. ### Method GET ### Endpoint /api/v2/projects/{project_id} ### Parameters #### Path Parameters - **project_id** (String) - Required - The ID of the project to retrieve. ### Response #### Success Response (200) - **(Response Body)** - Details of the project. (Type not specified in source) ### Response Example ```json // Example response structure (actual response may vary) { "project": { "id": 123, "name": "Example Project", "status": "open" } } ``` ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### Create a Project using ProjectsApi Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ProjectsApi.md Use this method to create a new project in Freshservice. You will need to provide a Project object. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.ProjectsApi(); let project = new FreshserviceApiSdkCodegen.Project(); // Project | project that needs to be created apiInstance.createProject(project).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### List Tickets with Options Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/TicketsApi.md Demonstrates how to list tickets using the Freshservice API SDK. It shows how to instantiate the TicketsApi and pass various optional parameters for filtering, sorting, and including additional data. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.TicketsApi(); let opts = { filter: "filter_example", // String | Pre-defined filters. The filters available are [new_and_my_open, watching, spam, deleted]. email: "email_example", // String | Query param to filter out tickets requester's email id. requester_id: 56, // Number | Query param to filter out tickets created by a particular requester. updated_since: "updated_since_example", // String | Query param to filter out tickets based on updated time. E.g. '?updated_since=2015-01-19T02:00:00Z'. include: "include_example", // String | Query param to include certain fields in response. E.g. '?include=stats' Will return the ticket’s closed_at, resolved_at and first_responded_at time. '?include=requester' Will return the requester's email, id, mobile, name, and phone. order_type: "order_type_example" // String | Query param to sort the list of tickets. Supported values - 'asc' and 'desc'. Default is 'desc' }; apiInstance.listTickets(opts).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Get job posting by ID Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/freshteam/job-postings.md Retrieves a specific job posting by its unique identifier. ```APIDOC ## Get job posting by ID ### Description Retrieves a specific job posting by its unique identifier. The response is a `Response` object that resolves to a `Freshteam.models.Job` object. ### Method GET ### Endpoint /job-postings/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the job posting. ### Response #### Success Response (200) - **json()**: Resolves to a `Freshteam.models.Job` object. ``` -------------------------------- ### List Applications with Pagination Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ApplicationsApi.md Demonstrates how to instantiate the ApplicationsApi and call the listApplications method with per_page and page parameters for pagination. Handles both successful API calls and errors. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.ApplicationsApi(); let opts = { per_page: 10, // Number | The number of entries to retrieve in each page of a paginated list. page: 1 // Number | The page number to retrieve. }; apiInstance.listApplications(opts).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Get employee by ID Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/freshteam/employees.md Retrieves a specific employee's details using their unique ID. ```APIDOC ## Get employee by ID ### Description Retrieves a specific employee's details using their unique ID. ### Method GET ### Endpoint /employees/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the employee. ### Response #### Success Response (200) - **Freshteam.models.EmployeeDetail** object ### Response Example { "example": "Freshteam.models.EmployeeDetail" } ``` -------------------------------- ### getTimeoffType Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshteam/docs/TimeoffApi.md Get Timeoff Type details. Retrieve details for a specific time off type using its ID. ```APIDOC ## GET /time_off_types/{id} ### Description Get Timeoff Type details ### Method GET ### Endpoint /time_off_types/{id} ### Parameters #### Path Parameters - **id** (Number) - Required - The ID of the timeoff type to retrieve. ### Response #### Success Response (200) - **Timeoff Type** (Object) - Details of the timeoff type. ### Authorization [ApiKeyAuth](../README.md#ApiKeyAuth) ``` -------------------------------- ### createSolutionFolder Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/SolutionArticlesApi.md Creates a new solution folder in Freshservice. Requires a SolutionFolder object in the request body. ```APIDOC ## createSolutionFolder ### Description Creates a new solution folder in Freshservice. ### Method POST ### Endpoint /solution_folders ### Parameters #### Request Body - **solution_folder** (SolutionFolder) - Required - Folder that needs to be created ### Request Example ```javascript let solution_folder = new FreshserviceApiSdkCodegen.SolutionFolder(); // SolutionFolder | Folder that needs to be created apiInstance.createSolutionFolder(solution_folder).then(data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); }); ``` ### Response #### Success Response (200) - **CreateSolutionFolder200Response** (CreateSolutionFolder200Response) - Description of the response object #### Response Example { "example": "response body" } ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ``` -------------------------------- ### getOnboardingRequestForm Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/EmployeeOnboardingApi.md Displays the details of the onboarding form, including all available fields for initiators. ```APIDOC ## GET /api/v2/onboarding_requests/form ### Description Retrieve a list of all fields in the initiator form. ### Method GET ### Endpoint /api/v2/onboarding_requests/form ### Parameters #### Request Body - **body** (GetOnboardingRequestFormRequest) - Optional - Request body for getting onboarding form details. ### Request Example ```javascript let opts = { body: new FreshserviceApiSdkCodegen.GetOnboardingRequestFormRequest() }; apiInstance.getOnboardingRequestForm(opts).then(data => { console.log(data); }, error => { console.error(error); }); ``` ### Response #### Success Response (200) - **data** (OnboardingForm) - Details of the onboarding form fields. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Get Sub Departments List Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshteam/docs/SubDepartmentsApi.md Fetches a list of all sub-departments in the account. API key authentication is required. ```javascript import FreshteamApiSdkCodegen from "freshteam-api-sdk-codegen"; let defaultClient = FreshteamApiSdkCodegen.ApiClient.instance; // Configure API key authorization: ApiKeyAuth let ApiKeyAuth = defaultClient.authentications["ApiKeyAuth"]; ApiKeyAuth.apiKey = "YOUR API KEY"; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) // ApiKeyAuth.apiKeyPrefix = 'Token'; let apiInstance = new FreshteamApiSdkCodegen.SubDepartmentsApi(); apiInstance.getSubDepartments().then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### List Solution Articles Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/SolutionArticlesApi.md Lists all solution articles, with options for pagination and filtering by folder or category. Use 'per_page' for entries per page and 'page' for the page number. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.SolutionArticlesApi(); let opts = { per_page: 30, // Number | The number of entries to retrieve in each page of a paginated list. page: 1, // Number | The page number to retrieve. folder_id: 56, // Number | The ID of the folder whose solution articles have to be listed. category_id: 56 // Number | The ID of the category whose solution articles have to be listed. }; apiInstance.listSolutionArticle(opts).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Get Solution Folder Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/SolutionArticlesApi.md Retrieves a specific solution folder by its ID. The folder_id must be a valid number. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.SolutionArticlesApi(); let folder_id = 789; // Number | ID of solution folder apiInstance.getSolutionFolder(folder_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Get Solution Category Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/SolutionArticlesApi.md Retrieves a specific solution category by its ID. The category_id must be a valid number. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.SolutionArticlesApi(); let category_id = 789; // Number | ID of solution category apiInstance.getSolutionCategory(category_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### createOnboardingRequest Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/EmployeeOnboardingApi.md Creates a new Onboarding Request in Freshservice. This operation allows for the initiation of the employee onboarding process. ```APIDOC ## POST /api/v2/onboarding_requests ### Description Create a new Onboarding Request in Freshservice. ### Method POST ### Endpoint /api/v2/onboarding_requests ### Parameters #### Request Body - **onboarding_request** (OnboardingRequestFields) - Optional - onboarding request that needs to be created ### Request Example ```javascript let opts = { onboarding_request: new FreshserviceApiSdkCodegen.OnboardingRequestFields() }; apiInstance.createOnboardingRequest(opts).then(data => { console.log(data); }, error => { console.error(error); }); ``` ### Response #### Success Response (201) - **data** (CreateOnboardingRequest201Response) - Details of the created onboarding request. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Get Solution Article Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/SolutionArticlesApi.md Retrieves a specific solution article by its ID. Ensure the article_id is a valid number. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.SolutionArticlesApi(); let article_id = 789; // Number | ID of solution article apiInstance.getSolutionArticle(article_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### listApplications Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ApplicationsApi.md List all software applications in Freshservice. ```APIDOC ## GET /api/v2/applications ### Description List all Software in Freshservice ### Method GET ### Endpoint /api/v2/applications ### Response #### Success Response (200) - **ListApplications200Response** - Description of the response object ### Request Example ```javascript let apiInstance = new FreshserviceApiSdkCodegen.ApplicationsApi(); apiInstance.listApplications().then(data => { console.log(data); }, error => { console.error(error); }); ``` ``` -------------------------------- ### GET /api/v2/projects/{id}/tasks Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ProjectsApi.md List all Project Tasks for a given project. Requires the project ID. ```APIDOC ## GET /api/v2/projects/{id}/tasks ### Description List all Project Tasks for a given project in Freshservice. ### Method GET ### Endpoint /api/v2/projects/{id}/tasks ### Parameters #### Path Parameters - **id** (Number) - Required - The ID of the project. ### Response #### Success Response (200) - **(Response Body)** - A list of project tasks. (Type not specified in source) ### Response Example ```json // Example response structure (actual response may vary) { "tasks": [ { "id": 456, "project_id": 789, "title": "Task 1", "status": "open" }, { "id": 457, "project_id": 789, "title": "Task 2", "status": "closed" } ] } ``` ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### getCannedResponseFolder Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/CannedResponseFoldersApi.md Retrieves a specific canned response folder by its ID. This allows you to get details about a single folder. ```APIDOC ## getCannedResponseFolder ### Description Retrieves a specific canned response folder by its ID. ### Method GET ### Endpoint /api/v2/response_foders/{canned_response_folder_id} ### Parameters #### Path Parameters - **canned_response_folder_id** (Number) - Required - ID of Canned Response to retrieve ### Response #### Success Response (200) - **CreateCannedResponse201Response** (object) - Details of the canned response folder. ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### createSolutionFolder Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/SolutionArticlesApi.md Creates a new solution folder within Freshservice. Folders help in organizing solution articles within categories. ```APIDOC ## POST /api/v2/solutions/folders ### Description Create a solution folder ### Method POST ### Endpoint /api/v2/solutions/folders ### Parameters #### Request Body - **solution_folder** (SolutionFolder) - Required - Folder that needs to be created ### Response #### Success Response (200) - **CreateSolutionFolder200Response** (CreateSolutionFolder200Response) - Description ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ``` -------------------------------- ### Add Usage Description for New Option Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/contributing/how-to-support-new-spec.md Updates the usage function to include a description for the new command-line option that generates client libraries for a product. ```sh # Adding help section function usage() { ... echo "--generate-{{prod_name}} -> Generates TypeScript Node SDK for {{prod_name}} APIs" ... } ``` -------------------------------- ### Delete Freshservice Location Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/LocationsApi.md This example demonstrates how to delete an existing location by its ID. The location_id must be provided. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.LocationsApi(); let location_id = 56; // Number | apiInstance.deleteLocation(location_id).then( () => { console.log("API called successfully."); }, error => { console.error(error); } ); ``` -------------------------------- ### getTimeoff Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshteam/docs/TimeoffApi.md Get Timeoff Request details. Retrieve detailed information about a specific time off request using its ID. ```APIDOC ## GET /time_offs/{id} ### Description Get Timeoff Request details ### Method GET ### Endpoint /time_offs/{id} ### Parameters #### Path Parameters - **id** (Number) - Required - The ID of the timeoff request to retrieve. ### Response #### Success Response (200) - **Timeoff Request** (Object) - Details of the timeoff request. ### Authorization [ApiKeyAuth](../README.md#ApiKeyAuth) ``` -------------------------------- ### POST /api/v2/projects Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ProjectsApi.md Create a new Project in Freshservice. Requires project details. ```APIDOC ## POST /api/v2/projects ### Description Create a new Project in Freshservice. ### Method POST ### Endpoint /api/v2/projects ### Parameters #### Request Body - **project** (Project) - Required - An object containing the details of the project to be created. See [Project](Project.md) for schema. ### Request Example ```javascript // Example using Javascript SDK let apiInstance = new FreshserviceApiSdkCodegen.ProjectsApi(); let project = new FreshserviceApiSdkCodegen.Project(); // Instantiate a Project object // Set project properties here, e.g., project.name = "New Project"; apiInstance.createProject(project).then(data => console.log(data)).catch(error => console.error(error)); ``` ### Response #### Success Response (200) - **(Response Body)** - Details of the newly created project. (Type not specified in source) ### Response Example ```json // Example response structure (actual response may vary) { "project": { "id": 123, "name": "New Project", "status": "open" } } ``` ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ``` -------------------------------- ### Get Applicant Details Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshteam/docs/ApplicantApi.md Retrieves details for a specific applicant using their identifier. Requires API key authentication. ```javascript import FreshteamApiSdkCodegen from "freshteam-api-sdk-codegen"; let defaultClient = FreshteamApiSdkCodegen.ApiClient.instance; // Configure API key authorization: ApiKeyAuth let ApiKeyAuth = defaultClient.authentications["ApiKeyAuth"]; ApiKeyAuth.apiKey = "YOUR API KEY"; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //ApiKeyAuth.apiKeyPrefix = 'Token'; let apiInstance = new FreshteamApiSdkCodegen.ApplicantApi(); let id = 56; // Number | the applicant identifier, as id apiInstance.getApplicant(id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### List Requesters with Filters Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/RequestersApi.md Demonstrates how to list requesters using the Freshservice API SDK. It shows how to instantiate the API client and make a call to the listRequesters method with various optional parameters for filtering. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.RequestersApi(); let opts = { per_page: 10, // Number | The number of entries to retrieve in each page of a paginated list. page: 1, // Number | The page number to retrieve. email: "email_example", // String | The email address for which the corresponding requester needs to be listed. mobile_phone_number: "mobile_phone_number_example", // String | The mobile phone number for which the corresponding requesters need to be listed. work_phone_number: "work_phone_number_example", // String | The work phone number for which the corresponding requesters need to be listed. active: true, // Boolean | Signifies if the user accounts to be listed are active (true), or have been deactivated. Not applying this filter returns both active and deactivated accounts. query: "query_example" // String | The simple or compound query which needs to be applied as a filter to the list of requesters. This string needs to be URL encoded.
Supported Query Parameters:
first_name, last_name, job_title, primary_email, secondary_emails, work_phone_number, mobile_phone_number, department_id, reporting_manager_id, time_zone, language, location_id, created_at, updated_at, (all custom fields).
Sample Query: https://account.freshservice.com/api/v2/requesters?query=\"job_titile:'HR Manager' AND created_at:>'2018-08-10'\" }; apiInstance.listRequesters(opts).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Get Announcement by ID in Freshservice Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/AnnouncementsApi.md Retrieve a specific announcement by its ID. The method returns the announcement details if found. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.AnnouncementsApi(); let announcement_id = 789; // Number | ID of Announcement to retrieve apiInstance.getAnnouncement(announcement_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Generate Product Specific Stub Classes Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/contributing/how-to-update-spec.md Use this command to generate API client stub classes for a specific product. ```sh # Generates product specific stub classes ./codegen/generate.sh --generate-{{prod_name}} ``` -------------------------------- ### Initialize Freshservice API Client Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/README.md Initialize the Freshservice client with your domain and API key. This client is used to interact with Freshservice APIs. ```js const { Freshservice } = require("@freshworks/api-sdk"); const fs = new Freshservice(domain, apiKey); ``` -------------------------------- ### Get sub-department by ID Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/freshteam/sub-departments.md Retrieves a specific sub-department by its ID. The returned Promise resolves to a single Freshteam.models.SubDepartment object. ```APIDOC ## Get sub-department by ID ### Description Retrieves a specific sub-department using its unique identifier. ### Method GET ### Endpoint /freshteam/sub-departments/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the sub-department. ### Response #### Success Response (200) - **subDepartment** (Freshteam.models.SubDepartment) - The requested sub-department object. ``` -------------------------------- ### Get level by ID Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/freshteam/levels.md Retrieves a specific level by its unique identifier. The response can be accessed using the .json() method. ```APIDOC ## Get level by ID ### Description Retrieves a specific level by its unique identifier. The response can be accessed using the .json() method. ### Method GET ### Endpoint /levels/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the level. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **level** (Freshteam.models.Level) - A Level object. ### Response Example ```json { "id": 1, "name": "Junior Developer", "order": 1 } ``` ``` -------------------------------- ### CreateSolutionFolder200Response Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/CreateSolutionFolder200Response.md Represents the response object returned after successfully creating a solution folder. It contains details about the created solution folder. ```APIDOC ## CreateSolutionFolder200Response ### Description This object represents the successful response from creating a solution folder. ### Properties #### solution_folder - **solution_folder** (object) - Optional - Contains the details of the newly created solution folder. The structure is defined in the [SolutionFolder](SolutionFolder.md) schema. ``` -------------------------------- ### Run Unit Tests and Specific Test Cases Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/docs/contributing/how-to-support-new-spec.md Commands to execute all unit tests or a specific test case within the project. This is used after adding product-specific test directories and suites. ```sh # To run all unit test cases npm run-script test:unit # To run specific test case npm run-script test:unit ``` -------------------------------- ### Get Ticket Time Entry Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/TicketsApi.md Retrieves a specific time entry for a given ticket ID. Requires both ticket_id and time_entry_id. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.TicketsApi(); let ticket_id = 789; // Number | ID of ticket request let time_entry_id = 789; // Number | ID of the time entry apiInstance.getTicketTimeEntry(ticket_id, time_entry_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Get Sub Department Details Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshteam/docs/SubDepartmentsApi.md Retrieves the details of a specific sub-department by its ID. Ensure API key authentication is configured. ```javascript import FreshteamApiSdkCodegen from "freshteam-api-sdk-codegen"; let defaultClient = FreshteamApiSdkCodegen.ApiClient.instance; // Configure API key authorization: ApiKeyAuth let ApiKeyAuth = defaultClient.authentications["ApiKeyAuth"]; ApiKeyAuth.apiKey = "YOUR API KEY"; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) // ApiKeyAuth.apiKeyPrefix = 'Token'; let apiInstance = new FreshteamApiSdkCodegen.SubDepartmentsApi(); let id = 56; // Number | the sub department identifier, as id apiInstance.getSubDepartment(id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### Get a specific release task Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ReleasesApi.md Retrieves a specific task associated with a release. Requires both the release ID and the task ID. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.ReleasesApi(); let release_id = 789; // Number | ID of release let task_id = 789; // Number | ID of the task apiInstance.getReleaseTask(release_id, task_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ``` -------------------------------- ### List Solution Folders Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/SolutionArticlesApi.md Retrieves a list of all Solution Folders in Freshservice. Supports filtering by category and pagination. ```APIDOC ## GET /api/v2/solution/folders ### Description List All Solution Folders Retrieve a list of all Solution Folders in Freshservice ### Method GET ### Endpoint /api/v2/solution/folders ### Parameters #### Query Parameters - **category_id** (Number) - Optional - ID of solution category in which the folders reside - **per_page** (Number) - Optional - The number of entries to retrieve in each page of a paginated list. [default to 30] - **page** (Number) - Optional - The page number to retrieve. [default to 1] ### Return type [**ListSolutionFolders200Response**](ListSolutionFolders200Response.md) ### Authorization No authorization required ``` -------------------------------- ### Get a specific release note Source: https://github.com/freshworks-oss/freshworks-api-sdk/blob/main/src/gen/freshservice/docs/ReleasesApi.md Retrieves a specific note associated with a release. Requires both the release ID and the note ID. ```javascript import FreshserviceApiSdkCodegen from "freshservice-api-sdk-codegen"; let apiInstance = new FreshserviceApiSdkCodegen.ReleasesApi(); let release_id = 789; // Number | ID of release let note_id = 789; // Number | ID of the note apiInstance.getReleaseNote(release_id, note_id).then( data => { console.log("API called successfully. Returned data: " + data); }, error => { console.error(error); } ); ```