Difference between revisions of "API:Opportunity:Type:Get"

From docs
Jump to: navigation, search
(Created page with "== API » Get Opportunity Type == '''URL:''' <nowiki>https://app.callproof.com/api/opportunity/type/get/</nowiki> '''Method:''' GET '''Required Fields:''' * '''''k...")
 
 
Line 1: Line 1:
== [[API]] &#187; Get Opportunity Type ==
+
== [[API]] &#187; Get Opportunity Types ==
 +
=== Base URL ===
 +
https://app.callproof.com
  
'''URL:''' <nowiki>https://app.callproof.com/api/opportunity/type/get/</nowiki>
+
=== Endpoint ===
 +
/api/opportunity/type/get/
  
'''Method:''' GET
+
=== Purpose ===
 +
Retrieves the opportunity types configured for your CallProof company. Use this to obtain the available opportunity categories that can be assigned when creating or managing opportunities.
  
'''Required Fields:'''
+
=== HTTP Method ===
 +
GET
  
* '''''key''''' - API Key
+
=== Headers ===
* '''''secret''''' - API Key Secret
+
No required headers.
  
 +
{| class="wikitable"
 +
! Header !! Required !! Description
 +
|-
 +
| — || — || No headers are required for this endpoint. Authentication is provided via query parameters.
 +
|}
  
'''Optional Fields:'''
+
=== Security ===
None
+
* '''Yes''' – Requires a valid API key and secret with permission to read opportunities.
  
 +
=== Parameters ===
  
'''Data Returned:'''
+
==== Path Parameters ====
 +
None.
  
* '''''results''''' - Opportunity type of company
+
==== Query Parameters ====
* '''''errors''''' - Array of errors produced by the request
+
{| class="wikitable"
* '''''code''''' - HTTP request status
+
! Parameter !! Type !! Required !! Description
 +
|-
 +
| key || string || Yes || Public API key assigned to your CallProof account.
 +
|-
 +
| secret || string || Yes || Private API secret paired with the API key.
 +
|}
 +
 
 +
==== Request Body ====
 +
None.
 +
 
 +
=== cURL Example ===
 +
<pre>
 +
curl -X GET "https://app.callproof.com/api/opportunity/type/get/?key=YOUR_API_KEY&secret=YOUR_API_SECRET"
 +
</pre>
 +
 
 +
=== Successful Response (200) ===
 +
Returns the opportunity types available for your company, ordered by their configured position.
 +
 
 +
{| class="wikitable"
 +
! Field !! Type !! Description
 +
|-
 +
| results || array || List of opportunity types.
 +
|-
 +
| results[].id || integer || Unique identifier for the opportunity type.
 +
|-
 +
| results[].name || string || Display name of the opportunity type.
 +
|-
 +
| errors || object || Empty object when the request succeeds.
 +
|-
 +
| code || integer || HTTP-style status value; <code>200</code> on success.
 +
|}
 +
 
 +
Example response:
 +
<pre>
 +
{
 +
  "results": [
 +
    {
 +
      "id": 1,
 +
      "name": "New Business"
 +
    },
 +
    {
 +
      "id": 2,
 +
      "name": "Renewal"
 +
    },
 +
    {
 +
      "id": 3,
 +
      "name": "Upsell"
 +
    }
 +
  ],
 +
  "errors": {},
 +
  "code": 200
 +
}
 +
</pre>
 +
 
 +
=== Notes ===
 +
* Returns only opportunity types belonging to your company.
 +
* Types are ordered by their configured position.
 +
* If no opportunity types are configured, the response returns an empty <code>results</code> list with status <code>200</code>.
 +
* This endpoint does not support pagination or filtering.
 +
* Type IDs from this endpoint can be used when creating opportunities.
 +
 
 +
=== Error Responses ===
 +
{| class="wikitable"
 +
! Status Code !! Meaning
 +
|-
 +
| 401 || Unauthorized – The API key and/or secret is missing, invalid, inactive, associated with a disabled account, or lacks permission to read opportunities.
 +
|-
 +
| 405 || Method Not Allowed – A method other than GET was used.
 +
|-
 +
| 500 || Internal Server Error – An unexpected server problem occurred. Not specified in Swagger.
 +
|}
 +
 
 +
'''401 response body example:'''
 +
<pre>
 +
{
 +
  "results": [],
 +
  "errors": ["Invalid API Key"],
 +
  "code": 401
 +
}
 +
</pre>
 +
 
 +
'''405 response body example:'''
 +
<pre>
 +
{
 +
  "results": [],
 +
  "errors": ["Method not allowed"],
 +
  "code": 405
 +
}
 +
</pre>

Latest revision as of 14:42, 17 July 2026

API » Get Opportunity Types

Base URL

https://app.callproof.com

Endpoint

/api/opportunity/type/get/

Purpose

Retrieves the opportunity types configured for your CallProof company. Use this to obtain the available opportunity categories that can be assigned when creating or managing opportunities.

HTTP Method

GET

Headers

No required headers.

Header Required Description
No headers are required for this endpoint. Authentication is provided via query parameters.

Security

  • Yes – Requires a valid API key and secret with permission to read opportunities.

Parameters

Path Parameters

None.

Query Parameters

Parameter Type Required Description
key string Yes Public API key assigned to your CallProof account.
secret string Yes Private API secret paired with the API key.

Request Body

None.

cURL Example

curl -X GET "https://app.callproof.com/api/opportunity/type/get/?key=YOUR_API_KEY&secret=YOUR_API_SECRET"

Successful Response (200)

Returns the opportunity types available for your company, ordered by their configured position.

Field Type Description
results array List of opportunity types.
results[].id integer Unique identifier for the opportunity type.
results[].name string Display name of the opportunity type.
errors object Empty object when the request succeeds.
code integer HTTP-style status value; 200 on success.

Example response:

{
  "results": [
    {
      "id": 1,
      "name": "New Business"
    },
    {
      "id": 2,
      "name": "Renewal"
    },
    {
      "id": 3,
      "name": "Upsell"
    }
  ],
  "errors": {},
  "code": 200
}

Notes

  • Returns only opportunity types belonging to your company.
  • Types are ordered by their configured position.
  • If no opportunity types are configured, the response returns an empty results list with status 200.
  • This endpoint does not support pagination or filtering.
  • Type IDs from this endpoint can be used when creating opportunities.

Error Responses

Status Code Meaning
401 Unauthorized – The API key and/or secret is missing, invalid, inactive, associated with a disabled account, or lacks permission to read opportunities.
405 Method Not Allowed – A method other than GET was used.
500 Internal Server Error – An unexpected server problem occurred. Not specified in Swagger.

401 response body example:

{
  "results": [],
  "errors": ["Invalid API Key"],
  "code": 401
}

405 response body example:

{
  "results": [],
  "errors": ["Method not allowed"],
  "code": 405
}