GET
/deals/:id/Get deal
You can return details about a specific deal.
| Attributes | Type | Required | Description |
|---|---|---|---|
| id | string | yes | A unique identifier for the deal 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"
-H "Accept: */*; version=2" "https://<your_app_subdomain>.user.com/api/public/deals/:id/"
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/deals/:id/");
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/deals/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
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")
payload = ""
headers = { 'authorization': "Token <your_64_char_api_key>", "Accept": "*/*; version=2" }
conn.request("GET", "/api/public/deals/:id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Response
{
"id": 12218,
"name": "example deal",
"value": "1200.00",
"currency": "USD",
"custom_id": null,
"stage": 36585,
"pipeline": 6179,
"assigned_to": 398,
"restricted_to": null,
"agent": null,
"company_id": 768,
"user_id": 20900530,
"status": 1,
"products": [
185582,
201009
],
"scope": 2,
"created_by": 382,
"created_at": "2017-09-06T09:53:50.748535Z",
"updated_at": "2017-09-06T09:53:50.748555Z",
"tags": [{"id": 9, "name": "To call"}],
"activities_status": "planned",
"expected_close_date": null,
"loss_reason": null,
"loss_reason_description": "",
"lost_at": null,
"won_at": null,
"participants": [4],
"user_custom_id": "52bdc3be5145e87076c8",
"products_custom_id": [
"product_972348",
"product_9423548"
],
"company_custom_id": "c44adda2ecc0",
"custom_attribute_xyz": null,
"order_products": [
{
"product_id": 185582,
"product_custom_id": "product_972348",
"currency": "USD",
"value": "500.00",
"quantity": 2
},
{
"product_id": 201009,
"product_custom_id": "product_9423548",
"currency": "USD",
"value": "200.00",
"quantity": 1
}
]
}