Difference between revisions of "API:Reps:Stats:HTML:Delete"

From docs
Jump to: navigation, search
Line 1: Line 1:
 +
== [[API]] » Delete Rep Stats HTML ==
  
== [[API]] » Delete Sales Rep Stats HTML ==
+
== Delete Rep Stats HTML ==
  
'''URL:''' <nowiki>https://app.callproof.com/api/reps/stats/html/delete/</nowiki>
+
=== Base URL ===
 +
https://app.callproof.com
  
'''Method:''' POST
+
=== Endpoint ===
 +
/api/reps/stats/html/delete/
  
'''Required Fields:'''
+
=== Purpose ===
 +
Removes the custom HTML statistics content for a specific sales representative. Use this endpoint to clear a rep's stored statistics HTML when it is no longer needed. The sales representative record is not deleted; only the associated HTML content is removed.
  
* '''''api_key[key]''''' - API Key
+
=== HTTP Method ===
* '''''api_key[secret]''''' - API Key Secret
+
POST
* '''''rep[id]''''' - Sales Rep ID
 
  
'''Optional Fields:'''
+
=== Headers ===
  
* '''''None'''''
+
{| class="wikitable"
 +
! Header !! Required !! Description
 +
|-
 +
| Content-Type || Yes || Must be <code>application/json</code>.
 +
|}
  
'''Data Returned:'''
+
=== Security ===
  
* '''''results''''' - Array containing updated Sales Rep Stats HTML
+
* '''Yes''' – Requires a valid API key and secret with permission to delete rep statistics HTML. Authentication credentials are provided in the request body.
* '''''errors''''' - Array of errors produced by the request
+
 
* '''''code''''' - HTTP request status
+
=== Parameters ===
 +
 
 +
==== Path Parameters ====
 +
None.
 +
 
 +
==== Query Parameters ====
 +
None.
 +
 
 +
==== Request Body ====
 +
 
 +
{| class="wikitable"
 +
! Parameter !! Type !! Required !! Description
 +
|-
 +
| api_key || object || Yes || Authentication credentials.
 +
|-
 +
| api_key.key || string || Yes || Public API key assigned to your CallProof account.
 +
|-
 +
| api_key.secret || string || Yes || Private API secret associated with the API key.
 +
|-
 +
| rep || object || Yes || Sales representative information.
 +
|-
 +
| rep.id || integer || Yes || User ID of the sales representative whose stored HTML statistics should be deleted.
 +
|}
 +
 
 +
=== cURL Example ===
 +
 
 +
<pre>
 +
curl -X POST "https://app.callproof.com/api/reps/stats/html/delete/" \
 +
  -H "Content-Type: application/json" \
 +
  -d '{
 +
    "api_key": {
 +
      "key": "YOUR_API_KEY",
 +
      "secret": "YOUR_API_SECRET"
 +
    },
 +
    "rep": {
 +
      "id": 456
 +
    }
 +
  }'
 +
</pre>
 +
 
 +
=== Successful Response (200) ===
 +
 
 +
Returns the sales representative's statistics record after the HTML content has been removed.
 +
 
 +
{| class="wikitable"
 +
! Field !! Type !! Description
 +
|-
 +
| results || object || Updated rep statistics record.
 +
|-
 +
| results.user_id || integer || User ID of the sales representative.
 +
|-
 +
| results.user || string || Sales representative's display name.
 +
|-
 +
| results.email || string || Sales representative's email address.
 +
|-
 +
| results.html || null || HTML statistics content after deletion.
 +
|-
 +
| errors || array || Empty when the request succeeds.
 +
|-
 +
| code || integer || HTTP-style status code (<code>200</code>).
 +
|}
 +
 
 +
Example response:
 +
 
 +
<pre>
 +
{
 +
  "results": {
 +
    "user_id": 456,
 +
    "user": "Jane Smith",
 +
    "email": "rep@example.com",
 +
    "html": null
 +
  },
 +
  "errors": [],
 +
  "code": 200
 +
}
 +
</pre>
 +
 
 +
=== Error Responses ===
 +
 
 +
{| class="wikitable"
 +
! Status Code !! Meaning
 +
|-
 +
| 400 || Bad Request – The rep ID is missing, invalid, or does not belong to your company.
 +
|-
 +
| 401 || Unauthorized – The API key or secret is missing, invalid, inactive, associated with a disabled account, or does not have permission to delete rep statistics.
 +
|-
 +
| 405 || Method Not Allowed – A method other than POST was used.
 +
|-
 +
| 500 || Internal Server Error – An unexpected server error occurred.
 +
|}
 +
 
 +
'''400 response example:'''
 +
 
 +
<pre>
 +
{
 +
  "results": [],
 +
  "errors": [
 +
    "Invalid 'id' field"
 +
  ],
 +
  "code": 400
 +
}
 +
</pre>
 +
 
 +
'''401 response example:'''
 +
 
 +
<pre>
 +
{
 +
  "results": [],
 +
  "errors": [
 +
    "Invalid API Key"
 +
  ],
 +
  "code": 401
 +
}
 +
</pre>
 +
 
 +
'''405 response example:'''
 +
 
 +
<pre>
 +
{
 +
  "results": [],
 +
  "errors": [
 +
    "Method not allowed"
 +
  ],
 +
  "code": 405
 +
}
 +
</pre>
 +
 
 +
=== Notes ===
 +
 
 +
* This endpoint removes only the stored HTML statistics for the specified sales representative.
 +
* The sales representative account and profile remain unchanged.
 +
* If no HTML statistics exist for the specified representative, the request completes without affecting the user record.
 +
* The <code>rep.id</code> must reference a valid sales representative belonging to the authenticated company.
 +
* Authentication credentials are supplied in the JSON request body rather than HTTP headers.
 +
* This endpoint accepts only <code>POST</code> requests with a JSON payload.

Revision as of 07:52, 17 July 2026

API » Delete Rep Stats HTML

Delete Rep Stats HTML

Base URL

https://app.callproof.com

Endpoint

/api/reps/stats/html/delete/

Purpose

Removes the custom HTML statistics content for a specific sales representative. Use this endpoint to clear a rep's stored statistics HTML when it is no longer needed. The sales representative record is not deleted; only the associated HTML content is removed.

HTTP Method

POST

Headers

Header Required Description
Content-Type Yes Must be application/json.

Security

  • Yes – Requires a valid API key and secret with permission to delete rep statistics HTML. Authentication credentials are provided in the request body.

Parameters

Path Parameters

None.

Query Parameters

None.

Request Body

Parameter Type Required Description
api_key object Yes Authentication credentials.
api_key.key string Yes Public API key assigned to your CallProof account.
api_key.secret string Yes Private API secret associated with the API key.
rep object Yes Sales representative information.
rep.id integer Yes User ID of the sales representative whose stored HTML statistics should be deleted.

cURL Example

curl -X POST "https://app.callproof.com/api/reps/stats/html/delete/" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": {
      "key": "YOUR_API_KEY",
      "secret": "YOUR_API_SECRET"
    },
    "rep": {
      "id": 456
    }
  }'

Successful Response (200)

Returns the sales representative's statistics record after the HTML content has been removed.

Field Type Description
results object Updated rep statistics record.
results.user_id integer User ID of the sales representative.
results.user string Sales representative's display name.
results.email string Sales representative's email address.
results.html null HTML statistics content after deletion.
errors array Empty when the request succeeds.
code integer HTTP-style status code (200).

Example response:

{
  "results": {
    "user_id": 456,
    "user": "Jane Smith",
    "email": "rep@example.com",
    "html": null
  },
  "errors": [],
  "code": 200
}

Error Responses

Status Code Meaning
400 Bad Request – The rep ID is missing, invalid, or does not belong to your company.
401 Unauthorized – The API key or secret is missing, invalid, inactive, associated with a disabled account, or does not have permission to delete rep statistics.
405 Method Not Allowed – A method other than POST was used.
500 Internal Server Error – An unexpected server error occurred.

400 response example:

{
  "results": [],
  "errors": [
    "Invalid 'id' field"
  ],
  "code": 400
}

401 response example:

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

405 response example:

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

Notes

  • This endpoint removes only the stored HTML statistics for the specified sales representative.
  • The sales representative account and profile remain unchanged.
  • If no HTML statistics exist for the specified representative, the request completes without affecting the user record.
  • The rep.id must reference a valid sales representative belonging to the authenticated company.
  • Authentication credentials are supplied in the JSON request body rather than HTTP headers.
  • This endpoint accepts only POST requests with a JSON payload.