Skip to content

Latest commit

 

History

History
487 lines (337 loc) · 15 KB

StagesApi.md

File metadata and controls

487 lines (337 loc) · 15 KB

Pipedrive\StagesApi

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

Method HTTP request Description
addStage() POST /stages Add a new stage
deleteStage() DELETE /stages/{id} Delete a stage
deleteStages() DELETE /stages Delete multiple stages in bulk
getStage() GET /stages/{id} Get one stage
getStageDeals() GET /stages/{id}/deals Get deals in a stage
getStages() GET /stages Get all stages
updateStage() PUT /stages/{id} Update stage details

addStage()

addStage($stage): \Pipedrive\Model\GetAddUpdateStage

Add a new stage

Adds a new stage, returns the ID upon success.

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\StagesApi(
    // 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
);
$stage = new \Pipedrive\Model\Stage(); // \Pipedrive\Model\Stage

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

Parameters

Name Type Description Notes
stage \Pipedrive\Model\Stage [optional]

Return type

\Pipedrive\Model\GetAddUpdateStage

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]

deleteStage()

deleteStage($id): \Pipedrive\Model\DeleteStageResponse200

Delete a stage

Marks a stage as deleted.

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\StagesApi(
    // 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 stage

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

Parameters

Name Type Description Notes
id int The ID of the stage

Return type

\Pipedrive\Model\DeleteStageResponse200

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]

deleteStages()

deleteStages($ids): \Pipedrive\Model\DeleteStagesResponse200

Delete multiple stages in bulk

Marks multiple stages as deleted.

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\StagesApi(
    // 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
);
$ids = 'ids_example'; // string | The comma-separated stage IDs to delete

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

Parameters

Name Type Description Notes
ids string The comma-separated stage IDs to delete

Return type

\Pipedrive\Model\DeleteStagesResponse200

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]

getStage()

getStage($id, $everyone): \Pipedrive\Model\GetOneStage

Get one stage

Returns data about a specific stage.

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\StagesApi(
    // 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 stage
$everyone = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | If `everyone=1` is provided, deals summary will return deals owned by every user

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

Parameters

Name Type Description Notes
id int The ID of the stage
everyone \Pipedrive\Model\NumberBoolean If `everyone=1` is provided, deals summary will return deals owned by every user [optional]

Return type

\Pipedrive\Model\GetOneStage

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]

getStageDeals()

getStageDeals($id, $filter_id, $user_id, $everyone, $start, $limit): \Pipedrive\Model\GetStageDeals

Get deals in a stage

Lists deals in a specific stage.

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\StagesApi(
    // 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 stage
$filter_id = 56; // int | If supplied, only deals matching the given filter will be returned
$user_id = 56; // int | If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned.
$everyone = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned
$start = 0; // int | Pagination start
$limit = 56; // int | Items shown per page

try {
    $result = $apiInstance->getStageDeals($id, $filter_id, $user_id, $everyone, $start, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling StagesApi->getStageDeals: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id int The ID of the stage
filter_id int If supplied, only deals matching the given filter will be returned [optional]
user_id int If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. [optional]
everyone \Pipedrive\Model\NumberBoolean If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned [optional]
start int Pagination start [optional] [default to 0]
limit int Items shown per page [optional]

Return type

\Pipedrive\Model\GetStageDeals

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]

getStages()

getStages($pipeline_id, $start, $limit): \Pipedrive\Model\GetStages

Get all stages

Returns data about all stages.

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\StagesApi(
    // 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
);
$pipeline_id = 56; // int | The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched.
$start = 0; // int | Pagination start
$limit = 56; // int | Items shown per page

try {
    $result = $apiInstance->getStages($pipeline_id, $start, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling StagesApi->getStages: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
pipeline_id int The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. [optional]
start int Pagination start [optional] [default to 0]
limit int Items shown per page [optional]

Return type

\Pipedrive\Model\GetStages

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]

updateStage()

updateStage($id, $update_stage_request): \Pipedrive\Model\GetAddUpdateStage

Update stage details

Updates the properties of a stage.

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\StagesApi(
    // 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 stage
$update_stage_request = new \Pipedrive\Model\UpdateStageRequest(); // \Pipedrive\Model\UpdateStageRequest

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

Parameters

Name Type Description Notes
id int The ID of the stage
update_stage_request \Pipedrive\Model\UpdateStageRequest [optional]

Return type

\Pipedrive\Model\GetAddUpdateStage

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]