I am using the PHP API and I am trying to create a new ticket with the API, but I am getting the following error.
Exception when calling basic_api->create: [400] Client error: `POST https://api.hubapi.com/crm/v3/objects/tickets?hapikey=XXX` resulted in a `400 Bad Request` response: {"status":"error","message":"Error creating TICKET. Some required properties were not set.","correlationId":"a0136598-f (truncated...)
I just tried a plain CURL request with the same full body and it fires correctly and creates the ticket.
Something in the library/dependencies/configuration/versioning seems to be creating the empty body.
Since both me and my collegue have the same exact issue would suggest there is a broader problem than just a single configuration right? We have tried it from atleast 3 machines and a server. All same issue.
When I look at the received request somehow the body seems empty, I tried using the api docs interface with our API and that does create the body. Can dependencies/phpversions etc. be blocking the actual sending of the content body?
VS
Hoping to get some insights, will try and send a clean CURL with all the parameters as well to verify this might be the issue.
I have checked and found that the properties values that you are sending are not correct. Please send the id of the pipeline and pipeline stage instead name.
$properties = [
"hs_pipeline" => "0",
"hs_pipeline_stage" => "1",
"hs_ticket_priority" => "HIGH",
"hubspot_owner_id" => "",
"subject" => "Example Ticket",
"content" => "I am creating a new ticket"
];
I have tested with the above array and got the 201 success code.
HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates. Learn More.
The answers given above are incorrect. The problem is that the SDK's sanitization routine is bugged so it's stripping the request of all its POST fields before it sends the create request, meaning the SDK cannot be used to create a ticket at this time.
I've posted an issue to their GitHub; we'll see if they can fix it soon.