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 Rep Stats HTML ==
 
== Delete Rep Stats HTML ==
 
  
 
=== Base URL ===
 
=== Base URL ===

Latest revision as of 12:00, 17 July 2026

API » 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.