APIs & Integrations

yorambaron
Participant

How to create a ticket with "hs_pipeline" property other than "0" using the API

SOLVE

Hello,

 

I want to create ticket using the HubSpot API to a pipeline other than "0" (which is the default one). 

Is it possible?

How do you get the IDs of all the pipelines? I tried to use the crm-pipelines API but it didn't work.

 

Thanks,

Yoram

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

How to create a ticket with "hs_pipeline" property other than "0" using the API

SOLVE

Hey @yorambaron,

 

The `hs_pipeline` parameter that you set when creating ticket via this endpoint: Create a ticket is referring to the `pipelineId` returned on this endpoint:  Get all pipelines for a specified object type and the `hs_pipeline_stage` is referring to the `stageId`.

 

E.g. I send a GET request to Get all pipelines for a specified object type on your portal and I'm able to note that the Customer Service pipeline has a pipelineId - 1091395 and the stage `New Customer Email (Waiting on us)` has a stageId - 1091398.

 

As such if you're looking to create a ticket using the Create a ticket endpoint with ticket under pipeline Customer Service and ticket stage as `New Customer Email (Waiting on us)`, you pass the following body:

 

[
  {
    "name": "subject",
    "value": "This is an hs test ticket"
  },
  {
    "name": "content",
    "value": "Test"
  },
  {
    "name": "hs_pipeline",
    "value": "1091395"
  },
  {
    "name": "hs_pipeline_stage",
    "value": "1091398"
  }
]

Hope this helps to further clarify things!

View solution in original post

0 Upvotes
4 Replies 4
WendyGoh
HubSpot Employee
HubSpot Employee

How to create a ticket with "hs_pipeline" property other than "0" using the API

SOLVE

Hey @yorambaron,

 

Are you looking to retrieve all the tickets pipeline by using this endpoint - Get all pipelines for a specified object type for portal 6052xxx?

 

If so, I'm able to see that the endpoint return 6 ticket pipeline when I send a GET request to 

https://api.hubspot.com/crm-pipelines/v1/pipelines/tickets

In this case, do you mind sharing with me the request body that you received upon sending the GET request? Are you getting any errors in particular?

0 Upvotes
yorambaron
Participant

How to create a ticket with "hs_pipeline" property other than "0" using the API

SOLVE

Hello WendyGoh,

 

Thanks for your reply.

 

I want to create a ticket for a  pipeline which is not the default one ("0").

The values that I recieved in the crm_pipeline in the "pipelineId" attribute could not be used to create a new ticket (I recived the error: "Property values were not valid" when I used the "pipelineId" attribute that was returned from the   crm_pipeline API).

 

When I used the value "0" for the "hs_pipeline" property to create a ticket everthing worked fine.

 

Do you follow me?

 

Regards,

Yoram

 

0 Upvotes
yorambaron
Participant

How to create a ticket with "hs_pipeline" property other than "0" using the API

SOLVE

Hello WendyGoh,

 

In order to get the hs_pipeline and hs_pipeline_stage correct values you need to call to the following API:

https://api.hubapi.com/crm-objects/v1/objects/tickets/<number>?hapikey=<value>&properties=subject&pr....

 

After setting the correct values (that are returned from this API) I could create a ticket with a different pipeline.

 

The problem is resolved.

WendyGoh
Solution
HubSpot Employee
HubSpot Employee

How to create a ticket with "hs_pipeline" property other than "0" using the API

SOLVE

Hey @yorambaron,

 

The `hs_pipeline` parameter that you set when creating ticket via this endpoint: Create a ticket is referring to the `pipelineId` returned on this endpoint:  Get all pipelines for a specified object type and the `hs_pipeline_stage` is referring to the `stageId`.

 

E.g. I send a GET request to Get all pipelines for a specified object type on your portal and I'm able to note that the Customer Service pipeline has a pipelineId - 1091395 and the stage `New Customer Email (Waiting on us)` has a stageId - 1091398.

 

As such if you're looking to create a ticket using the Create a ticket endpoint with ticket under pipeline Customer Service and ticket stage as `New Customer Email (Waiting on us)`, you pass the following body:

 

[
  {
    "name": "subject",
    "value": "This is an hs test ticket"
  },
  {
    "name": "content",
    "value": "Test"
  },
  {
    "name": "hs_pipeline",
    "value": "1091395"
  },
  {
    "name": "hs_pipeline_stage",
    "value": "1091398"
  }
]

Hope this helps to further clarify things!

0 Upvotes