Skip to content

Latest commit

 

History

History
202 lines (136 loc) · 5.97 KB

WebhooksApi.md

File metadata and controls

202 lines (136 loc) · 5.97 KB

Pipedrive\WebhooksApi

All URIs are relative to https://api.pipedrive.com/v1.

Method HTTP request Description
addWebhook() POST /webhooks Create a new Webhook
deleteWebhook() DELETE /webhooks/{id} Delete existing Webhook
getWebhooks() GET /webhooks Get all Webhooks

addWebhook()

addWebhook($add_webhook_request): \Pipedrive\Model\Webhook

Create a new Webhook

Creates a new Webhook and returns its details. Note that specifying an event which triggers the Webhook combines 2 parameters - event_action and event_object. E.g., use *.* for getting notifications about all events, added.deal for any newly added deals, deleted.persons for any deleted persons, etc. See <a href="https://pipedrive.readme.io/docs/guide-for-webhooks?ref=api_reference\" target="_blank" rel="noopener noreferrer">the guide for Webhooks for more details.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key
$config = (new Pipedrive\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Pipedrive\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$add_webhook_request = new \Pipedrive\Model\AddWebhookRequest(); // \Pipedrive\Model\AddWebhookRequest

try {
    $result = $apiInstance->addWebhook($add_webhook_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->addWebhook: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
add_webhook_request \Pipedrive\Model\AddWebhookRequest [optional]

Return type

\Pipedrive\Model\Webhook

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteWebhook()

deleteWebhook($id): \Pipedrive\Model\BaseResponseWithStatus

Delete existing Webhook

Deletes the specified Webhook.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key
$config = (new Pipedrive\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Pipedrive\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 56; // int | The ID of the Webhook to delete

try {
    $result = $apiInstance->deleteWebhook($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->deleteWebhook: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id int The ID of the Webhook to delete

Return type

\Pipedrive\Model\BaseResponseWithStatus

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getWebhooks()

getWebhooks(): \Pipedrive\Model\Webhooks

Get all Webhooks

Returns data about all the Webhooks of a company.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key
$config = (new Pipedrive\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Pipedrive\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->getWebhooks();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->getWebhooks: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\Pipedrive\Model\Webhooks

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]