Hello!
I am trying to create an activity using pipedrive’s API with google scripts
every time i send a request it creates an activity but it doesn’t use any of my set parameters
this is my code:
var data = {
“done”:“1”,
“subject”:“Test Ping”,
“type”:“Call”,
“due_date”: due_date,
“due_time”:due_time,
“duration”:“01:00”
}
var request = {
“method”:“POST”,
“headers”:{“Content-Type”:“application/json”},
“data”: data
};
console.log({‘Atividade’:request});
var response = UrlFetchApp.fetch(url, request);
var Json = JSON.parse(response.getContentText());
console.log({‘Json’:Json});
}
This is Pipedrive JSON response printed :
{ success: true,
data:
{ id: 3599,
company_id: 6683270,
user_id: 9981052,
done: false,
type: ‘call’,
reference_type: null,
reference_id: null,
conference_meeting_client: null,
conference_meeting_url: null,
due_date: ‘2020-07-10’,
due_time: ‘’,
duration: ‘’,
busy_flag: null,
add_time: ‘2020-07-10 12:29:13’,
marked_as_done_time: ‘’,
last_notification_time: null,
last_notification_user_id: null,
notification_language_id: null,
subject: ‘Ligar’,
public_description: null,
calendar_sync_include_context: null,
location: null,
org_id: null,
person_id: null,
deal_id: null,
lead_id: null,
lead_title: ‘’,
active_flag: true,
update_time: ‘2020-07-10 12:29:13’,
update_user_id: null,
gcal_event_id: null,
google_calendar_id: null,
google_calendar_etag: null,
source_timezone: null,
rec_rule: null,
rec_rule_extension: null,
rec_master_activity_id: null,
conference_meeting_id: null,
note: null,
created_by_user_id: 9981052,
location_subpremise: null,
location_street_number: null,
location_route: null,
location_sublocality: null,
location_locality: null,
location_admin_area_level_1: null,
location_admin_area_level_2: null,
location_country: null,
location_postal_code: null,
location_formatted_address: null,
attendees: null,
participants: null,
series: null,
org_name: null,
person_name: null,
deal_title: null,
owner_name: ‘Lana’,
person_dropbox_bcc: null,
deal_dropbox_bcc: null,
assigned_to_user_id: 9981052,
file: null },
additional_data: { updates_story_id: null },
related_objects: { user: [Object] } } }"
I can’t get that right, can someone help me out?