Skip to content

Latest commit

 

History

History
798 lines (629 loc) · 48 KB

File metadata and controls

798 lines (629 loc) · 48 KB

Crm

Overview

Available Operations

listContacts

List Contacts

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\CrmListContactsRequest(
    xAccountId: '<id>',
    fields: 'id,remote_id,first_name,last_name,company_name,emails,phone_numbers,deal_ids,remote_deal_ids,account_ids,remote_account_ids,custom_fields,created_at,updated_at,unified_custom_fields',
    filter: new Operations\CrmListContactsQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    include: 'custom_fields',
    prefer: 'heartbeat',
);

$responses = $sdk->crm->listContacts(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\CrmListContactsRequest ✔️ The request object to use for the request.

Response

?Operations\CrmListContactsResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

createContact

Create Contact

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$crmCreateContactRequestDto = new Components\CrmCreateContactRequestDto(
    firstName: 'Steve',
    lastName: 'Wozniak',
    companyName: 'Apple Inc.',
    emails: [
        'steve@apple.com',
    ],
    phoneNumbers: [
        '123-456-7890',
    ],
    dealIds: [
        'deal-001',
        'deal-002',
    ],
    accountIds: [
        'account-123',
        'account-456',
    ],
    customFields: [
        new Components\CustomFields(
            id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
            remoteId: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
            name: 'Training Completion Status',
            value: 'Completed',
            valueId: 'value_456',
            remoteValueId: 'e3cb75bf-aa84-466e-a6c1-b8322b257a48',
        ),
    ],
    passthrough: [
        'other_known_names' => 'John Doe',
    ],
);

$response = $sdk->crm->createContact(
    xAccountId: '<id>',
    crmCreateContactRequestDto: $crmCreateContactRequestDto,
    prefer: 'heartbeat'

);

if ($response->contactResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
xAccountId string ✔️ The account identifier
crmCreateContactRequestDto Components\CrmCreateContactRequestDto ✔️ N/A
prefer ?string Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

?Operations\CrmCreateContactResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

getContact

Get Contact

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\CrmGetContactRequest(
    xAccountId: '<id>',
    id: '<id>',
    fields: 'id,remote_id,first_name,last_name,company_name,emails,phone_numbers,deal_ids,remote_deal_ids,account_ids,remote_account_ids,custom_fields,created_at,updated_at,unified_custom_fields',
    include: 'custom_fields',
    prefer: 'heartbeat',
);

$response = $sdk->crm->getContact(
    request: $request
);

if ($response->contactResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\CrmGetContactRequest ✔️ The request object to use for the request.

Response

?Operations\CrmGetContactResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

updateContact

Update Contact (early access)

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$crmCreateContactRequestDto = new Components\CrmCreateContactRequestDto(
    firstName: 'Steve',
    lastName: 'Wozniak',
    companyName: 'Apple Inc.',
    emails: [
        'steve@apple.com',
    ],
    phoneNumbers: [
        '123-456-7890',
    ],
    dealIds: [
        'deal-001',
        'deal-002',
    ],
    accountIds: [
        'account-123',
        'account-456',
    ],
    customFields: [
        new Components\CustomFields(
            id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
            remoteId: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
            name: 'Training Completion Status',
            value: 'Completed',
            valueId: 'value_456',
            remoteValueId: 'e3cb75bf-aa84-466e-a6c1-b8322b257a48',
        ),
    ],
    passthrough: [
        'other_known_names' => 'John Doe',
    ],
);

$response = $sdk->crm->updateContact(
    xAccountId: '<id>',
    id: '<id>',
    crmCreateContactRequestDto: $crmCreateContactRequestDto,
    prefer: 'heartbeat'

);

if ($response->contactResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
xAccountId string ✔️ The account identifier
id string ✔️ N/A
crmCreateContactRequestDto Components\CrmCreateContactRequestDto ✔️ N/A
prefer ?string Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

?Operations\CrmUpdateContactResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

listAccounts

List Accounts

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\CrmListAccountsRequest(
    xAccountId: '<id>',
    fields: 'id,remote_id,owner_id,remote_owner_id,name,description,industries,annual_revenue,website,addresses,phone_numbers,created_at,updated_at,unified_custom_fields',
    filter: new Operations\CrmListAccountsQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$responses = $sdk->crm->listAccounts(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\CrmListAccountsRequest ✔️ The request object to use for the request.

Response

?Operations\CrmListAccountsResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

getAccount

Get Account

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\CrmGetAccountRequest(
    xAccountId: '<id>',
    id: '<id>',
    fields: 'id,remote_id,owner_id,remote_owner_id,name,description,industries,annual_revenue,website,addresses,phone_numbers,created_at,updated_at,unified_custom_fields',
    prefer: 'heartbeat',
);

$response = $sdk->crm->getAccount(
    request: $request
);

if ($response->accountResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\CrmGetAccountRequest ✔️ The request object to use for the request.

Response

?Operations\CrmGetAccountResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

listLists

Get all Lists

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\CrmListListsRequest(
    xAccountId: '<id>',
    fields: 'id,remote_id,name,created_at,updated_at,items,type,unified_custom_fields',
    filter: new Operations\CrmListListsQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$responses = $sdk->crm->listLists(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\CrmListListsRequest ✔️ The request object to use for the request.

Response

?Operations\CrmListListsResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

getList

Get List

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\CrmGetListRequest(
    xAccountId: '<id>',
    id: '<id>',
    fields: 'id,remote_id,name,created_at,updated_at,items,type,unified_custom_fields',
    prefer: 'heartbeat',
);

$response = $sdk->crm->getList(
    request: $request
);

if ($response->listResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\CrmGetListRequest ✔️ The request object to use for the request.

Response

?Operations\CrmGetListResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

listContactCustomFieldDefinitions

List Contact Custom Field Definitions

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\CrmListContactCustomFieldDefinitionsRequest(
    xAccountId: '<id>',
    fields: 'id,remote_id,name,description,type,options,unified_custom_fields',
    filter: new Operations\CrmListContactCustomFieldDefinitionsQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$responses = $sdk->crm->listContactCustomFieldDefinitions(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\CrmListContactCustomFieldDefinitionsRequest ✔️ The request object to use for the request.

Response

?Operations\CrmListContactCustomFieldDefinitionsResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*

getContactCustomFieldDefinition

Get Contact Custom Field Definition

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\CrmGetContactCustomFieldDefinitionRequest(
    xAccountId: '<id>',
    id: '<id>',
    fields: 'id,remote_id,name,description,type,options,unified_custom_fields',
    filter: new Operations\CrmGetContactCustomFieldDefinitionQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$response = $sdk->crm->getContactCustomFieldDefinition(
    request: $request
);

if ($response->customFieldDefinitionResultApiModel !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\CrmGetContactCustomFieldDefinitionRequest ✔️ The request object to use for the request.

Response

?Operations\CrmGetContactCustomFieldDefinitionResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\ForbiddenResponse 403 application/json
Errors\NotFoundResponse 404 application/json
Errors\RequestTimedOutResponse 408 application/json
Errors\ConflictResponse 409 application/json
Errors\PreconditionFailedResponse 412 application/json
Errors\UnprocessableEntityResponse 422 application/json
Errors\TooManyRequestsResponse 429 application/json
Errors\InternalServerErrorResponse 500 application/json
Errors\NotImplementedResponse 501 application/json
Errors\BadGatewayResponse 502 application/json
Errors\SDKException 4XX, 5XX */*