Skip to content

Latest commit

 

History

History
480 lines (397 loc) · 121 KB

File metadata and controls

480 lines (397 loc) · 121 KB

CollectionTickets

(issue_tracking.collection_tickets)

Overview

Available Operations

list

List Tickets

Example Usage

import apideck_unify
from apideck_unify import Apideck
import os


with Apideck(
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:

    res = apideck.issue_tracking.collection_tickets.list(collection_id="apideck-io", raw=False, service_id="salesforce", limit=20, sort={
        "by": apideck_unify.TicketsSortBy.CREATED_AT,
        "direction": apideck_unify.SortDirection.DESC,
    }, filter_={
        "status": [
            "open",
        ],
    }, pass_through={
        "search": "San Francisco",
    }, fields="id,updated_at")

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description Example
collection_id str ✔️ The collection ID apideck-io
raw Optional[bool] Include raw response. Mostly used for debugging purposes
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
cursor OptionalNullable[str] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response.
limit Optional[int] Number of results to return. Minimum 1, Maximum 200, Default 20
sort Optional[models.TicketsSort] Apply sorting {
"by": "created_at",
"direction": "desc"
}
filter_ Optional[models.IssuesFilter] Apply filters {
"status": [
"open"
]
}
pass_through Dict[str, Any] Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads {
"search": "San Francisco"
}
fields OptionalNullable[str] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: fields=name,email,addresses.city

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
id,updated_at
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.IssueTrackingCollectionTicketsAllResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

create

Create Ticket

Example Usage

import apideck_unify
from apideck_unify import Apideck
from apideck_unify.utils import parse_datetime
import os


with Apideck(
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:

    res = apideck.issue_tracking.collection_tickets.create(collection_id="apideck-io", raw=False, service_id="salesforce", parent_id="12345", type_="Technical", subject="Technical Support Request", description="I am facing issues with my internet connection", status="open", priority=apideck_unify.TicketPriority.HIGH, assignees=[
        {
            "id": "12345",
        },
        {
            "id": "12345",
        },
        {
            "id": "12345",
        },
    ], due_date=parse_datetime("2020-09-30T07:43:32.000Z"), tags=[
        {
            "id": "12345",
        },
        {
            "id": "12345",
        },
        {
            "id": "12345",
        },
    ], pass_through=[
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
    ])

    assert res.create_ticket_response is not None

    # Handle response
    print(res.create_ticket_response)

Parameters

Parameter Type Required Description Example
collection_id str ✔️ The collection ID apideck-io
raw Optional[bool] Include raw response. Mostly used for debugging purposes
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
parent_id OptionalNullable[str] The ticket's parent ID 12345
type OptionalNullable[str] The ticket's type Technical
subject OptionalNullable[str] Subject of the ticket Technical Support Request
description OptionalNullable[str] The ticket's description. HTML version of description is mapped if supported by the third-party platform I am facing issues with my internet connection
status OptionalNullable[str] The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. open
priority OptionalNullable[models.TicketPriority] Priority of the ticket high
assignees List[models.AssigneeInput] N/A
due_date date Due date of the ticket 2020-09-30T07:43:32.000Z
tags List[models.CollectionTagInput] N/A
pass_through List[models.PassThroughBody] The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.IssueTrackingCollectionTicketsAddResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

get

Get Ticket

Example Usage

from apideck_unify import Apideck
import os


with Apideck(
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:

    res = apideck.issue_tracking.collection_tickets.get(ticket_id="<id>", collection_id="apideck-io", service_id="salesforce", raw=False, fields="id,updated_at")

    assert res.get_ticket_response is not None

    # Handle response
    print(res.get_ticket_response)

Parameters

Parameter Type Required Description Example
ticket_id str ✔️ ID of the ticket you are acting upon.
collection_id str ✔️ The collection ID apideck-io
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
raw Optional[bool] Include raw response. Mostly used for debugging purposes
fields OptionalNullable[str] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: fields=name,email,addresses.city

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
id,updated_at
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.IssueTrackingCollectionTicketsOneResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

update

Update Ticket

Example Usage

import apideck_unify
from apideck_unify import Apideck
from apideck_unify.utils import parse_datetime
import os


with Apideck(
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:

    res = apideck.issue_tracking.collection_tickets.update(ticket_id="<id>", collection_id="apideck-io", service_id="salesforce", raw=False, parent_id="12345", type_="Technical", subject="Technical Support Request", description="I am facing issues with my internet connection", status="open", priority=apideck_unify.TicketPriority.HIGH, assignees=[
        {
            "id": "12345",
        },
        {
            "id": "12345",
        },
    ], due_date=parse_datetime("2020-09-30T07:43:32.000Z"), tags=[
        {
            "id": "12345",
        },
    ], pass_through=[
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
    ])

    assert res.update_ticket_response is not None

    # Handle response
    print(res.update_ticket_response)

Parameters

Parameter Type Required Description Example
ticket_id str ✔️ ID of the ticket you are acting upon.
collection_id str ✔️ The collection ID apideck-io
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
raw Optional[bool] Include raw response. Mostly used for debugging purposes
parent_id OptionalNullable[str] The ticket's parent ID 12345
type OptionalNullable[str] The ticket's type Technical
subject OptionalNullable[str] Subject of the ticket Technical Support Request
description OptionalNullable[str] The ticket's description. HTML version of description is mapped if supported by the third-party platform I am facing issues with my internet connection
status OptionalNullable[str] The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. open
priority OptionalNullable[models.TicketPriority] Priority of the ticket high
assignees List[models.AssigneeInput] N/A
due_date date Due date of the ticket 2020-09-30T07:43:32.000Z
tags List[models.CollectionTagInput] N/A
pass_through List[models.PassThroughBody] The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.IssueTrackingCollectionTicketsUpdateResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

delete

Delete Ticket

Example Usage

from apideck_unify import Apideck
import os


with Apideck(
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:

    res = apideck.issue_tracking.collection_tickets.delete(ticket_id="<id>", collection_id="apideck-io", service_id="salesforce", raw=False)

    assert res.delete_ticket_response is not None

    # Handle response
    print(res.delete_ticket_response)

Parameters

Parameter Type Required Description Example
ticket_id str ✔️ ID of the ticket you are acting upon.
collection_id str ✔️ The collection ID apideck-io
consumer_id Optional[str] ID of the consumer which you want to get or push data from test-consumer
app_id Optional[str] The ID of your Unify application dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
raw Optional[bool] Include raw response. Mostly used for debugging purposes
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.IssueTrackingCollectionTicketsDeleteResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*