GET
/deal-segments/:id/deals/View deal segment
You can return all deals assigned to a specific deal segment.
| Attributes | Type | Required | Description |
|---|---|---|---|
| id | integer | yes | A unique identifier for the deals' segment which is given by User.com automatically. |
Request
- CURL
- JavaScript
- PHP
- Python
curl -X GET -H "Authorization: Token <your_64_char_api_key>"
-H "Accept: */*; version=2"
"https://<your_app_subdomain>.user.com/api/public/deal-segments/:id/deals/"
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://<your_app_subdomain>.user.com/api/public/deal-segments/:id/deals/");
xhr.setRequestHeader("authorization", "Token <your_64_char_api_key>");
xhr.setRequestHeader("accept", "*/*; version=2");
xhr.send(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/deal-segments/:id/deals/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Accept: */*; version=2",
"authorization: Token <your_64_char_api_key>"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client
conn = http.client.HTTPSConnection("<your_app_subdomain>.user.com")
headers = { 'authorization': "Token <your_64_char_api_key>", "Accept": "*/*; version=2" }
conn.request("GET", "/api/public/deal-segments/:id/deals/", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Response
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 167812,
"name": "purchase1243",
"value": "100.00",
"currency": "USD",
"custom_id": null,
"stage": 28349,
"pipeline": 4760,
"assigned_to": 18408,
"agent": null,
"company": 574823,
"person": 162012368,
"products": [],
"status": 1,
"created_by": 17498,
"created_at": "2024-10-10T11:51:46.421758Z",
"updated_at": "2024-10-11T09:10:01.392361Z",
"tags": [],
"activities_status": "planned",
"expected_close_date": "2024-10-24",
"loss_reason": null,
"loss_reason_description": "",
"lost_at": null,
"won_at": null,
"participants": [],
"attributes": [
{
"name": "last_stage_change",
"name_std": "last_stage_change",
"value": "2024-10-11T09:08:44.888542Z",
"description": "last change of stage (other than frozen)",
"value_type": 5
}
],
"user_custom_id": null,
"products_custom_id": [],
"last_stage_change": "2024-10-11T09:08:44.888542Z"
},
{
"id": 167812,
"name": "purchase5432",
"value": "65.00",
"currency": "USD",
"custom_id": null,
"stage": 24234,
"pipeline": 122,
"assigned_to": 42432,
"agent": null,
"company": 22434,
"person": 563433,
"products": [],
"status": 1,
"created_by": 17498,
"created_at": "2024-10-10T11:51:46.421758Z",
"updated_at": "2024-10-11T09:10:01.392361Z",
"tags": [],
"activities_status": "planned",
"expected_close_date": "2024-10-24",
"loss_reason": null,
"loss_reason_description": "",
"lost_at": null,
"won_at": null,
"participants": [],
"attributes": [
{
"name": "last_stage_change",
"name_std": "last_stage_change",
"value": "2024-10-11T09:08:44.888542Z",
"description": "last change of stage (other than frozen)",
"value_type": 5
}
],
"user_custom_id": null,
"products_custom_id": [],
"last_stage_change": "2024-10-11T09:08:44.888542Z"
}
]
}