Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

The Vicidial Lead Dearchive API facilitates the dearchiving of leads within the Vicidial system.

Endpoint

Info

API is allowed to operate within office hours.

The endpoint server address will be provided by TForgeService Delivery.

Use the following endpoint to initiate your request:

Method

Endpoint

Description

POST

/vicidial/leadleads/dearchive

Lead dearchive endpoint

Authentication

API key will be provided by TForgeService Delivery.

To access the Lead Dearchive API, you must authenticate using an API key.

...

Code Block
Authorization: Key=YOUR_API_KEY
Content-Type: application/json

Request

Info

The API consistently executes operations in the following sequential order:

  1. insert_leads

  2. delete_leads

...

Field

Datatype

Description

insert_leads

true | false

This feature enables the insertion of specified lead IDs into the vicidial_list table. Lead IDs that are already present in the vicidial_list table will not be inserted again.

It is recommended to always set this feature to true.

delete_leads

true | false

This feature enables the deletion of specified lead IDs from the vicidial_list_archive table in a safe manner. Before deleting, the API checks if the specified lead IDs exists in the vicidial_list table and the column data matches the vicidial_list_archive table lead ID data.

Setting this feature to false will result in lead IDs remaining in the vicidial_list_archive table.

lead_ids

Integer

Specify the lead IDs that you wish to dearchive. The lead IDs limit is set by TForge. Ensure that the number of lead ID values does not exceed the set limit. Default limit is 500 valuesLimited to 500 leads per request.

CURL request example:

For testing, create a dummy list and load 500 leads.
Use created lead IDs and archive leads using the Lead Archive API.

...

Code Block
languagebash
curl -k -X POST https://server<server>/vicidial/leadleads/dearchive \
-H "Authorization: Key=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
      "insert_leads": true,
      "delete_leads": true,
      "lead_ids": [
        0,
        1
      ]
    }'

Response

Info

The API follows general HTTP response status codes. In addition to the HTTP code included in the JSON response, you can also rely on the HTTP status code returned by the response.

Tip

HTTP status code - 200

Returns the following successful response If there are no errors with the request or the specified lead IDs. The data will be processed based on the option values specified in the request JSON object.

Code Block
languagejson
{
  "message": "lead_ids batch was successfully processed",
  "select_count": 1,
  "insert_count": 1,
  "delete_count": 1,
  "http_code":
200
}

Warning

HTTP status code - 401

Returns the following error response if the API cannot validate the API user.

Code Block
languagejson
{
  "message": "unable to validate api user",
  "http_code": 401
}

Warning

HTTP status code - 403

Returns the following error response if the API was executed during office hours.

Code Block
languagejson
{
  "message": "api cannot be executed during office hours time condition",
  "http_code":
403
}

Warning

HTTP status code - 400

Returns the following error response if the value passed for insert_leads is not a bool value or no value was provided.

Code Block
languagejson
{
  "message": "insert_leads must be a boolean value",
  "http_codelead_errors": 0,
  "lead_ids": 400[]
}

Returns the following error response if the value passed for delete_leads is not a bool value or no value was provided.

Code Block
languagejson
{
  "message": "delete_leads must be a boolean value",
  "http_code"lead_errors": 0,
  "lead_ids": 400[]
}

Returns the following error response if the value passed for lead_ids is not an integer value or was passed with double quotes.

Code Block
languagejson
{
  "message": "lead_ids must only contain integer values",
  "lead_counterrors": 1,
  "lead_ids": [
    "0"
  ],
  "http_code": 400
}

Returns the following error response if no value was passed for lead_ids.

Code Block
languagejson
{
  "message": "lead_ids must contain atleast 1 value",
  "http_code"lead_errors": 0,
  "lead_ids": 400[]
}

Returns the following error response if the values passed for lead_ids exceed 500 values.

Code Block
languagejson
{
  "message": "lead_ids cannot exceed 500 values",
  "http_codelead_errors": 0,
  "lead_ids": 400[]
}

Returns the following error response if the values passed for lead_ids contain duplicate values.

Code Block
languagejson
{
  "message": "lead_ids cannot contain duplicate values",
  "lead_counterrors": 1,
  "lead_ids": [
    0
  ],
  "http_code": 400
}

Returns the following error response if the values passed for lead_ids do not exist in the vicidial_list table.

Code Block
languagejson
{
  "message": "lead_ids does not exist",
  "lead_count": 1,
  "lead_ids": [
    0
  ],
  "http_code":
400
}

Warning

HTTP status code - 500

Returns the following error response for any other errors not mentioned above.

Code Block
languagejson
{
  "message": "Unexpected character encountered while parsing number: s. Path 'lead_ids[97]', line 104, position 5.",
  "http_codelead_errors": 0,
  "lead_ids": 500
}

Conclusion

...

[]
}