Receive a person's email and phone number after creating a new deal

I’m using a webhook to create a new deal. I fill in the name, lastname, email, phone number, name of the organization and the name of the new deal.
As a result, I get the following json in my service:

req.body:  {
  v: 1,
  matches_filters: { current: [] },
  meta: {
    action: 'added',
    change_source: 'app',
    company_id: 10300721,
    host: '3smoney-sandbox.pipedrive.com',
    id: 18,
    is_bulk_update: false,
    matches_filters: { current: [] },
    object: 'deal',
    permitted_user_ids: [ 12810874 ],
    pipedrive_service_name: false,
    timestamp: 1643636630,
    timestamp_micro: 1643636630525610,
    trans_pending: false,
    user_id: 12810874,
    v: 1,
    webhook_id: '1396'
  },
  current: {
    email_messages_count: 0,
    cc_email: '3smoney-sandbox+deal18@pipedrivemail.com',
    products_count: 0,
    next_activity_date: null,
    next_activity_type: null,
    next_activity_duration: null,
    id: 18,
    person_id: 22,
    creator_user_id: 12810874,
    expected_close_date: null,
    owner_name: 'Oleg',
    participants_count: 0,
    group_name: null,
    stage_id: 1,
    probability: null,
    undone_activities_count: 0,
    renewal_type: 'one_time',
    active: true,
    person_name: 'uuuu yyyyy',
    last_activity_date: null,
    close_time: null,
    org_hidden: false,
    next_activity_id: null,
    weighted_value_currency: 'GBP',
    stage_order_nr: 0,
    next_activity_subject: null,
    rotten_time: null,
    user_id: 12810874,
    visible_to: '3',
    org_id: 39,
    notes_count: 0,
    next_activity_time: null,
    formatted_value: '£0',
    status: 'open',
    formatted_weighted_value: '£0',
    first_won_time: null,
    last_outgoing_mail_time: null,
    title: 'fofofofof deal',
    last_activity_id: null,
    update_time: '2022-01-31 13:43:50',
    activities_count: 0,
    pipeline_id: 1,
    lost_time: null,
    currency: 'GBP',
    weighted_value: 0,
    org_name: 'fofofofof',
    value: 0,
    person_hidden: false,
    next_activity_note: null,
    files_count: 0,
    last_incoming_mail_time: null,
    label: null,
    lost_reason: null,
    deleted: false,
    won_time: null,
    group_id: null,
    followers_count: 0,
    stage_change_time: null,
    add_time: '2022-01-31 13:43:50',
    done_activities_count: 0
  },
  previous: null,
  event: 'added.deal',
  retry: 0
}

But there is no email and the person’s phone number in it. And for me, this information is extremely important.
Is there any way to get this information?

Hey @okrupnik13
Thanks for sharing the required details :slight_smile:
You can retrieve the details pertaining to that deal by making a REST API call to Get Deal Details endpoint.

Hello, @Hem
Yes, I can. But in this case I get the following logic:
When creating a deak on pipeDrive, I call the route of my application, in which I also need to create a company, a person with the corresponding data and send a notification to the person’s email. But I can’t do that. And in order to get email and phone, I need to call pipeDrive again, transfer the received deal id to get the email and phone number of the person. And in the end, I need to send a 200 response to the pipeDrive for a spent webhook, so that pipeDrive does not re-do the webhook with a bad response.
Some strange logic, don’t you think? :slight_smile:

Maybe you have the opportunity to add the necessary fields to json when creating a new deal, when the corresponding webhook is working out?

If I understood you rightly, I see that you refer to route of my application as the webhook url in Pipedrive. You seem to be performing a set of steps (logic) in response to that as well. Let me know if I got it right :sweat_smile:

With that assumption, I agree that you might have to make multiple calls which may not be convenient but unfortunately, it’s the only way as of now. However, it is one of the feedback items that have already been captured. I will make sure there is more visibility to that :slight_smile:

From this, I get an impression that the logic is synchronous in nature.

  • Are you performing the sequence of steps and then responding with 200 ? → If this is is the case, this might complicate things. I would recommend decoupling it.
  • Perhaps the webhook trigger URL can respond with 200 OK and push it to a queue? The items in the queue can be consumed later for performing these steps.

But hey let me know if I am not seeing the full picture.

clear, I understand you, at the moment there are no other ways to get the user’s email and phone number, except for the Get a deal by its ID method

1 Like