It appears that the ‘SimplePublicObjectInputForCreate’ class is no longer available in the current version of the HubSpot API Python client library. The documentation you are referring to might be outdated or incorrect.
Instead, you can use the ‘PublicTicketCreateRequest’ class for creating new tickets.
Here’s an example
import hubspot
from pprint import pprint
from hubspot.crm.tickets import PublicTicketCreateRequest, ApiException
client = hubspot.Client.create(access_token="YOUR_ACCESS_TOKEN")
ticket_properties = {
"subject": "troubleshoot report",
"content": "Please help me troubleshoot this issue.",
"hs_pipeline": "support_pipeline",
"hs_pipeline_stage": "open",
"hs_ticket_priority": "HIGH",
"hubspot_owner_id": "910901"
}
ticket_create_request = PublicTicketCreateRequest(**ticket_properties)
try:
api_response = client.crm.tickets.basic_api.create(ticket_create_request)
pprint(api_response)
except ApiException as e:
print("Exception when calling basic_api->create: %s\n" % e)
You can find more information about the ‘PublicTicketCreateRequest’ class and its properties in the official HubSpot API documentation: Accounts Dashboard | HubSpot.
Thanks & Regards
Himanshu Rauthan
Figured out you have to keep off ForCreate
Do you have the library for the PHP version?
<?php
// Starting November 30, 2022, API keys will be sunset as an authentication method. Learn more about this change: Upcoming: API Key Sunset and how to migrate an API key integration: Developer platform - HubSpot docs to use a private app instead.
use HubSpot\Factory;
use HubSpot\Client\Crm\Contacts\ApiException;
use HubSpot\Client\Crm\Contacts\Model\BatchInputSimplePublicObjectInputForCreate;
use HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectInputForCreate;