APIs & Integrations

Abhimanyu
Colaborador(a)

Get Ticket detail by ticket is returning hs_pipeline and hs_pipeline_stage as number

resolver

Hi

 

When I try to get the details of the ticket by this api

Endpoint  : /crm/v3/objects/tickets/{ticketId} 

It is returning hs_pipeline and hs_pipeline_stage as number(their Id) as shown below in example 1 but I want to get then result as shown in example 2. Is there any way to achive it.

 

Example 1:

{
"id": "247495245",
"properties": {
"content": null,
"createdate": "2020-11-23T19:27:33.507Z",
"hs_lastmodifieddate": "2020-11-23T19:31:42.989Z",
"hs_object_id": "247495245",
"hs_pipeline": "6140873",
"hs_pipeline_stage": "6140874",
"hs_ticket_category": null,
"hs_ticket_priority": "MEDIUM",
"subject": "Time Card/ Comission report showing duplicate information"
},
"createdAt": "2020-11-23T19:27:33.507Z",
"updatedAt": "2020-11-23T19:31:42.989Z",
"archived": false
}

 

Example 2:

 

{
"createdAt": "2019-10-30T03:30:17.883Z",
"archived": false,
"id": "512",
"properties": {
"createdate": "2019-10-30T03:30:17.883Z",
"hs_lastmodifieddate": "2019-12-07T16:50:06.678Z",
"hs_pipeline": "support_pipeline",
"hs_pipeline_stage": "open",
"hs_ticket_priority": "HIGH",
"hubspot_owner_id": "910901",
"subject": "troubleshoot report"
},
"updatedAt": "2019-12-07T16:50:06.678Z"
}

 

 

0 Avaliação positiva
1 Solução aceita
MichaelC
Solução
Orientador(a) | Parceiro
Orientador(a) | Parceiro

Get Ticket detail by ticket is returning hs_pipeline and hs_pipeline_stage as number

resolver

Hi,

 

Since you are able to manually crete several deal stages and pipelines in your hubspot account there is nothing uniqe about the either the pipeline or the stage. You may for example name a pipeline stage the same thing in two different pipelines. 

 

You can either request the pipeline information by asking for one pipeline per id with the pipeline get integration. 

https://developers.hubspot.com/docs/api/crm/pipelines

 

But I recommend getting the full pipeline list with all its stages and creating an array early on in your code and that specifies all your names for you. I code in PHP and for me it would look similar to this:

 

/crm/v3/pipelines/{objectType}:

 

# $a_response_containing_json (where your request response is collected as a json)



foreach ($a_response_containing_json['results'] as $key => $value)

{

$pipeline_id = $a_response_containing_json['results'] [$key]['id'];

$my_pipeline_names[$pipeline_id] =  $a_response_containing_json['results'] [$key]['label'];



#to get all your stage names you will have to do an other foreach loop within this array

foreach ($a_response_containing_json['results'][$key]['stages']  as $key2 => $value2){



$stage_id = $a_response_containing_json['results'] [$key]['stages'][$key2]['id'];

$my_stage_names[$stage_id] = $a_response_containing_json['results'] [$key]['stages'][$key2]['label'];



}

}

 

The output of this will be two arrays

$my_pipeline_names[enter your pipeline id here];

$my_stage_names[enter your stage id here];



Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

Exibir solução no post original

3 Respostas 3
Abhimanyu
Colaborador(a)

Get Ticket detail by ticket is returning hs_pipeline and hs_pipeline_stage as number

resolver

Thank you @sharonlicari  and @MichaelC . I am trying to get the detail in same api so I don't have to hit pineline api.

Thank you for you response.

MichaelC
Solução
Orientador(a) | Parceiro
Orientador(a) | Parceiro

Get Ticket detail by ticket is returning hs_pipeline and hs_pipeline_stage as number

resolver

Hi,

 

Since you are able to manually crete several deal stages and pipelines in your hubspot account there is nothing uniqe about the either the pipeline or the stage. You may for example name a pipeline stage the same thing in two different pipelines. 

 

You can either request the pipeline information by asking for one pipeline per id with the pipeline get integration. 

https://developers.hubspot.com/docs/api/crm/pipelines

 

But I recommend getting the full pipeline list with all its stages and creating an array early on in your code and that specifies all your names for you. I code in PHP and for me it would look similar to this:

 

/crm/v3/pipelines/{objectType}:

 

# $a_response_containing_json (where your request response is collected as a json)



foreach ($a_response_containing_json['results'] as $key => $value)

{

$pipeline_id = $a_response_containing_json['results'] [$key]['id'];

$my_pipeline_names[$pipeline_id] =  $a_response_containing_json['results'] [$key]['label'];



#to get all your stage names you will have to do an other foreach loop within this array

foreach ($a_response_containing_json['results'][$key]['stages']  as $key2 => $value2){



$stage_id = $a_response_containing_json['results'] [$key]['stages'][$key2]['id'];

$my_stage_names[$stage_id] = $a_response_containing_json['results'] [$key]['stages'][$key2]['label'];



}

}

 

The output of this will be two arrays

$my_pipeline_names[enter your pipeline id here];

$my_stage_names[enter your stage id here];



Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

sharonlicari
Gerente da Comunidade
Gerente da Comunidade

Get Ticket detail by ticket is returning hs_pipeline and hs_pipeline_stage as number

resolver

Hey @Abhimanyu 

 

Thank you for reaching out! I'll mention a few experts that can share their knowledge with you!

 

Hey @himanshurauthan @HenryCipolla  any thoughts about this case?

 

Thank you 

Sharon


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Avaliação positiva