Retrieve an opportunity
Supply the unique identifier of the opportunity as opportunity_id and this API will retrieve the details of it.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
GET /v1/opportunities/{opportunity_id}
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| opportunity_id | string | Yes | Unique identifier of the opportunity. |
Response
Success (200 OK)
{
"oppportunity": {
"opportunity_id": "86c10c18-46e2-48a2-97da-08d43e430bde",
"opportunity_title": "28-March",
"opportunity_description": "28-March",
"opportunity_user_id": "5b2a4f2a-489b-45bf-9fc7-b2d413c2870b",
"opportunity_owner_id": "22acde81-9d93-4f2e-86b1-62c7e09f1824",
"opportunity_type": "Others",
"opportunity_no": 69,
"lead_source": {
"...": "..."
},
"creation_date": "2018-04-02T22:30:01",
"expected_close_date": "2018-04-04T00:00:00",
"followup_date": "2018-04-04T00:00:00",
"created_by": "Kirity Owner",
"sales_owner": "Chennai_mgr mgr",
"therapist_id": {},
"ticket_id": "485e23d3-ffa8-48b0-83c3-7f89c4e6e6ab",
"custom_fields": [
{
"...": "..."
}
],
"optional": {
"...": "..."
},
"price": {
"...": "..."
},
"stage": {
"...": "..."
},
"priority": {
"...": "..."
},
"guest": {
"...": "..."
},
"center": {
"...": "..."
},
"disposition": {
"...": "..."
}
}
}
Response fields
| Field | Type | Description |
|---|---|---|
| oppportunity | object | |
| oppportunity.opportunity_id | string | |
| oppportunity.opportunity_title | string | |
| oppportunity.opportunity_description | string | |
| oppportunity.opportunity_user_id | string | |
| oppportunity.opportunity_owner_id | string | |
| oppportunity.opportunity_type | string | |
| oppportunity.opportunity_no | integer | |
| oppportunity.lead_source | object | |
| oppportunity.creation_date | string | |
| oppportunity.expected_close_date | string | |
| oppportunity.followup_date | string | |
| oppportunity.created_by | string | |
| oppportunity.sales_owner | string | |
| oppportunity.therapist_id | object | |
| oppportunity.ticket_id | string | |
| oppportunity.custom_fields | object[] | |
| oppportunity.optional | object | |
| oppportunity.price | object | |
| oppportunity.stage | object | |
| oppportunity.priority | object | |
| oppportunity.guest | object | |
| oppportunity.center | object | |
| oppportunity.disposition | object |
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/opportunities/{opportunity_id}' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/opportunities/{opportunity_id}', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/opportunities/{opportunity_id}',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.GetAsync(
"https://api.zenoti.com/v1/opportunities/{opportunity_id}");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/opportunities/{opportunity_id}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)
Error codes
| Status | Description |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |