Skip to content

Latest commit

 

History

History
385 lines (296 loc) · 18.6 KB

README.md

File metadata and controls

385 lines (296 loc) · 18.6 KB

CollectionTickets

(issueTracking->collectionTickets)

Overview

Available Operations

create

Create Ticket

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
use Apideck\Unify\Utils;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\IssueTrackingCollectionTicketsAddRequest(
    collectionId: 'apideck-io',
    ticket: new Components\TicketInput(
        assignees: [
            new Components\AssigneeInput(
                id: '12345',
            ),
        ],
        tags: [
            new Components\CollectionTagInput(
                id: '12345',
            ),
        ],
        passThrough: [
            new Components\PassThroughBody(
                serviceId: '<id>',
                extendPaths: [
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                ],
            ),
        ],
        parentId: '12345',
        type: 'Technical',
        subject: 'Technical Support Request',
        description: 'I am facing issues with my internet connection',
        status: 'open',
        priority: Components\Priority::High,
        dueDate: Utils\Utils::parseDateTime('2020-09-30T07:43:32.000Z'),
    ),
    serviceId: 'salesforce',
);

$response = $sdk->issueTracking->collectionTickets->create(
    request: $request
);

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

Parameters

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

Response

?Operations\IssueTrackingCollectionTicketsAddResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*

list

List Tickets

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\IssueTrackingCollectionTicketsAllRequest(
    collectionId: 'apideck-io',
    serviceId: 'salesforce',
    sort: new Components\TicketsSort(
        by: Components\TicketsSortBy::CreatedAt,
        direction: Components\SortDirection::Desc,
    ),
    filter: new Components\IssuesFilter(
        status: [
            'open',
        ],
    ),
    passThrough: [
        'search' => 'San Francisco',
    ],
    fields: 'id,updated_at',
);

$responses = $sdk->issueTracking->collectionTickets->list(
    request: $request
);


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

Parameters

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

Response

?Operations\IssueTrackingCollectionTicketsAllResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*

delete

Delete Ticket

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\IssueTrackingCollectionTicketsDeleteRequest(
    ticketId: '<id>',
    collectionId: 'apideck-io',
    serviceId: 'salesforce',
);

$response = $sdk->issueTracking->collectionTickets->delete(
    request: $request
);

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

Parameters

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

Response

?Operations\IssueTrackingCollectionTicketsDeleteResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*

get

Get Ticket

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\IssueTrackingCollectionTicketsOneRequest(
    ticketId: '<id>',
    collectionId: 'apideck-io',
    serviceId: 'salesforce',
    fields: 'id,updated_at',
);

$response = $sdk->issueTracking->collectionTickets->get(
    request: $request
);

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

Parameters

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

Response

?Operations\IssueTrackingCollectionTicketsOneResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*

update

Update Ticket

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
use Apideck\Unify\Utils;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Unify\Apideck::builder()
    ->setConsumerId('test-consumer')
    ->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
    ->setSecurity($security)->build();

$request = new Operations\IssueTrackingCollectionTicketsUpdateRequest(
    ticketId: '<id>',
    collectionId: 'apideck-io',
    ticket: new Components\TicketInput(
        assignees: [
            new Components\AssigneeInput(
                id: '12345',
            ),
        ],
        tags: [
            new Components\CollectionTagInput(
                id: '12345',
            ),
        ],
        passThrough: [
            new Components\PassThroughBody(
                serviceId: '<id>',
                extendPaths: [
                    new Components\ExtendPaths(
                        path: '$.nested.property',
                        value: [
                            'TaxClassificationRef' => [
                                'value' => 'EUC-99990201-V1-00020000',
                            ],
                        ],
                    ),
                ],
            ),
        ],
        parentId: '12345',
        type: 'Technical',
        subject: 'Technical Support Request',
        description: 'I am facing issues with my internet connection',
        status: 'open',
        priority: Components\Priority::High,
        dueDate: Utils\Utils::parseDateTime('2020-09-30T07:43:32.000Z'),
    ),
    serviceId: 'salesforce',
);

$response = $sdk->issueTracking->collectionTickets->update(
    request: $request
);

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

Parameters

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

Response

?Operations\IssueTrackingCollectionTicketsUpdateResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestResponse 400 application/json
Errors\UnauthorizedResponse 401 application/json
Errors\PaymentRequiredResponse 402 application/json
Errors\NotFoundResponse 404 application/json
Errors\UnprocessableResponse 422 application/json
Errors\APIException 4XX, 5XX */*