freshworks / freshworks-api-sdk

Node.js client SDK for Freshworks' REST APIs, currently in beta. Supports Freshteam and Freshservice (partially).
https://developers.freshworks.com/api-sdk/
MIT License
6 stars 2 forks source link

Job Listing API fetches Trashed jobs #87

Open maruhgar opened 1 year ago

maruhgar commented 1 year ago

We are trying to list active jobs from our Freshteam account in our website. We have followed the instructions and are able to fetch jobs, but they are jobs which are in Trash..

If you see the API documentation, and specifically query parameters for the job listing, you see status - can be one of draft, published, internal, private, on_hold, closed. There is nodeleted query parameter - to filter by deleted != true

We raised a Support ticket with Freshteam #124126 12 days back. They said today

It is developed by the marketplace team. In this SDK there is no delete query param itself. So we request you to raise a support ticket in the developer community so that it will be handled by them. Or you can raise an issue in the GitHub repo:

Can we please add this? Here is the failing code snippet - pretty much from the documentation.

const { Freshteam } = require("@freshworks/api-sdk");

const ft = new Freshteam(`${process.env.FRESHTEAM_DOMAIN}.freshteam.com`, process.env.FRESHTEAM_API_KEY);

const getJobs = async () => {
    let obj = {
        status: ["published"]
    };
    try {
        const resp = await ft.jobPostings.list(obj);
        const jobs = await resp.json();
        console.log(jobs);
    } catch (err) {
        console.log(err);
    }
}
const allJobs = getJobs();

output.txt

trash