Find activities marked as done in the current week for an assigned a specific user

I’m create a web aplication Node JS ( with express ) than receive data from Pipedrive API.

Now, I need Find all activities assigned from a particular user than were marked as done in the current week.

I using pipedrive library too.So acctualy my code is this:

await pipedrive.ActivitiesController.getAllActivitiesAssignedToAParticularUser({
                      userId: idUserPipedrive,
                      limit: 500,
                      done: 1
                    }, async (error, response, context) => {
                      if (error) throw error;
                      let activities = response.data

Thus I recive all finished activities from the specific user - ALL THE TIME
I need just the activities marked as done in the current week.
If i use start_date and end_date in the query like the API reference, I so recive the activities when the due date is between start and end date.
THE DUE DATE DON’T IS THE SAME DATE THEN THE MARKED AS A DONE!

CAN WE HELP ME? PLEASE

Hi @pedrohhcunha,

Apologies for the late reply.

Yes, the due date is not the same as the marked as done date. I asked our developers and this is what they suggested for you to do.

  1. Manually create a filter via the Pipedrive UI.
  • In this instance, our dev did a filter for activities created today
  1. Get the filter ID from the URL once it’s created.
  2. The following code gives back activities that a specific user has marked as done today.
    NOTE: As our dev used async/await and you are using callbacks, you would have to add filterId: <your-filter-id>,
const lib = require('pipedrive');
lib.Configuration.apiToken = '<TOKEN>';

async function callAPI() {
	const resp = await lib.ActivitiesController.getAllActivitiesAssignedToAParticularUser({
		userId: <your-user-id>,
		done: 1,
		filterId: <your-filter-id>,
	});

	console.log(resp);
}

callAPI();

I hope this helps?