Hi Adam,
It seems to be working for both myself and another of our developers.
Postman
I used Postman to add an activity with the “Štúrova 1705/55, Praha” address as a location. This is the JSON array I sent:
{
"deal_id": "12",
"person_id": "17",
"location": "Štúrova 1705/55, Praha",
"subject": "Activity added from API with location",
"type": "lunch"
}
It came back with a 201 response, and this showed up in my web app:
Code from our developer
A developer of ours tried the endpoint, and it worked for him as well. This is the code he used.
Please do replace the your_
api
_token
and your_company_domain
sections with your own values.
<?php
// Content of addActivity.php
// Pipedrive API token
$api_token = 'your_api_token';
// Pipedrive company domain
$company_domain = 'your_company_domain';
// Information regarding the new Activity
$data = array(
'subject' => 'Activity added from API with location',
'type' => 'lunch',
'location' => 'Opletalova 25, Praha'
);
// URL for adding an Activity
$url = 'https://' . $company_domain . '.pipedrive.com/api/v1/activities?api_token=' . $api_token;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
echo 'Sending request...' . PHP_EOL;
$output = curl_exec($ch);
curl_close($ch);
// Create an array from the data that is sent back from the API
// As the original content from server is in JSON format, you need to convert it to PHP array
$result = json_decode($output, true);
// Check if the data returned in the result is not empty
if (empty($result['data'])) {
exit('Adding failed' . PHP_EOL);
}
// Check if the Activity's ID came back, if it did, print out success message
if (!empty($result['data']['id'])) {
echo 'Activity was added successfully!' . PHP_EOL;
}
Would you be able to try again with either/both of these methods, and let me know whether it works for you?