Hello,
I am hoping to use the API listed here:
/crm/v3/objects/tickets
(CRM API | Tickets (hubspot.com)
The error in my script says
Error creating TICKET. Some required properties were not set.
I put it into Postman and got this additional part:
{
"status": "error",
"message": "Error creating TICKET. Some required properties were not set.",
"correlationId": "bba1c5fe-59ce-4991-80ea-f21582b15658",
"context": {
"properties": \[
"hs\_pipeline\_stage"
]
},
"category": "VALIDATION\_ERROR"
}
The data I am sending:
{
"hs\_pipeline": 1,
"hs\_pipeline\_stage": 2,
"hs\_ticket\_priority": "HIGH",
"hubspot\_owner\_id": "3",
"subject": "Test: 12-0",
"gracoroberts\_order\_number": "12-0",
"source": "EMAIL",
"content": "Test ticket",
"hs\_ticket\_category": "Sales Order"
}
Noted I have checked the hs_pipeline, hs_pipeline_stage and hubspot_owner_id are the correct ones via both the UI and API outputs, where I ran:
https://api.hubapi.com/crm/v3/pipelines/tickets
Outputted the Pipeline and Stage, I pasted them in. I also pasted the exact names for hs_pipeline etc.
Also checked the owner id is an actual user, I went into users and took their ID. They are also active.
Hi, @EIbbetson
Thanks for reaching out. I cannot reproduce your error when using your example. I tested with my example:
As well as using the first 4 lines of your request body (I used copy + paste and changed the IDs to work with my portal) and testing from the documentation example here — POST
/crm/v3/objects/tickets
Request:
curl --request POST \
--url https://api.hubapi.com/crm/v3/objects/tickets \
--header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'content-type: application/json' \
--data '{
"properties": {
"hs_pipeline": 0,
"hs_pipeline_stage": 2,
"hs_ticket_priority": "HIGH",
"hubspot_owner_id": "198670650"
}
}'
Response:
HTTP 201
{
"id": "1317382811",
"properties": {
"createdate": "2022-12-13T20:34:07.713Z",
"hs_all_accessible_team_ids": "12073943",
"hs_all_owner_ids": "198670650",
"hs_all_team_ids": "12073943",
"hs_lastmodifieddate": "2022-12-13T20:34:07.713Z",
"hs_object_id": "1317382811",
"hs_pipeline": "0",
"hs_pipeline_stage": "2",
"hs_ticket_id": "1317382811",
"hs_ticket_priority": "HIGH",
"hs_user_ids_of_all_owners": "10233975",
"hubspot_owner_assigneddate": "2022-12-13T20:34:07.713Z",
"hubspot_owner_id": "198670650",
"hubspot_team_id": "12073943"
},
"createdAt": "2022-12-13T20:34:07.713Z",
"updatedAt": "2022-12-13T20:34:07.713Z",
"archived": false
}
In both examples, I successfully created a ticket in my test portal using the provided endpoint example.
One request, for the pipeline you are using, can you go to Settings > Objects > Tickets > Pipelines and verify the internal ID for your pipeline matches what you are inputting, please?
Best,
Jaycee
This is how I checked the Pipeline stage in the UI and again via API. It is correct for both the Pipeline and Stage.
My error seems to be complaining I haven’t got the stage in the properties body at all as it’s the same error if I remove the field entirely.
I reproduced this error on a test developer account, with a different auth token that allows for tickets.
In this scenario, the pipeline is 0 and the stage is 1. Can’t go wrong here. I used the same fields as you, got my Owner ID number. Still fails citing HS_PIPELINE_STAGE is missing. I also tried removing the hubspot_owner_id and the same error is returned.
{
“status”: “error”,
“message”: “Error creating TICKET. Some required properties were not set.”,
“correlationId”: “981ec9fd-bb1d-46c3-a2c0-09fa911fb1dd”,
“context”: {
“properties”: [
“hs_pipeline_stage”
]
},
“category”: “VALIDATION_ERROR”
}
I have resolved this. It requires the data to be encased inside a parent attribute:
{properties: {
data here
}}
This was not clear as the example provided for NodeJS is to use a wrapped API, however upon suggestion by a HubSpot developer, I am using Axios.