Get User Jobs
Retrieves a list of jobs for a specified user.
Method Signature
client.me.getUserJobs(query?: GetUserJobsQuery): Promise<GetUserJobsResponse>;
Parameters
query(optionalGetUserJobsQuery): An object containing optional query parameters for filtering and pagination. SeeGetUserJobsQuerytype intypes.tsfor details (e.g.,limit,offset,status).
Returns
(Promise<GetUserJobsResponse>): A promise that resolves to an object containing a list of user jobs and pagination details.
Usage Example
import { ImagineoAIClient } from "@imagineoai/javascript/browser"; // Or /server for Node.js
const imagine = new ImagineoAIClient({ apiKey: "YOUR_API_KEY" });
async function main() {
try {
const jobsResponse = await imagine.me.getUserJobs({ status: "completed" });
console.log("User jobs:", jobsResponse.jobs);
console.log("Total jobs:", jobsResponse.total);
} catch (error) {
console.error("Error fetching user jobs:", error);
}
}
main();