Versions Compared

Key

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

...

Code Block
languagejson
{
  "insert_leads": true,
  "update_leads": true,
  "delete_leads": true,
  "lead_ids": [
    12345,
    678900
  ]
}

JSON Object Key

Datatype

Description

insert_leads

true | false

This feature enables the insertion of leads into the vicidial_list_archive table. Leads that are already present in the vicidial_list_archive table will not be inserted again.

Use update_leads to ensure the lead data is synchronized for leads that were not inserted.

It is recommended to always set this feature to true.

update_leads

true | false

This feature enables the updation of leads. If a lead is already present in the vicidial_list_archive table, the API will update the lead data with the most recent information retrieved from the vicidial_list table.

It is recommended to always set this feature to true for optimal data synchronization.

delete_leads

true | false

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

Setting this feature to false will result in leads remaining in the vicidial_list table.

lead_ids

Integer values

Specify the lead IDs that you wish to archive. Ensure that the number of lead ID values does not exceed 500.

...

Code Block
languagebash
curl -k -X POST https://server/vicidial/lead/archive/ \
-H "Authorization: Key=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
      "insert_leads": true,
      "update_leads": true,
      "delete_leads": true,
      "lead_ids": [
        12345,
        678900
      ]
    }'

Response

Info

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

...

Code Block
languagejson
{
  "error": "lead_ids must only contain integer values",
  "lead_count": 1,
  "lead_ids": [
    "123450"
  ],
  "status_code": 435
}

...

Code Block
languagejson
{
  "error": "lead_ids cannot contain duplicate values",
  "lead_count": 1,
  "lead_ids": [
    123450
  ],
  "status_code": 438
}

Warning

HTTP status code - 439

...

Code Block
languagejson
{
  "error": "specified leads do not exist",
  "lead_count": 1,
  "values": [
    123450
  ],
  "status_code": 439
}

Warning

HTTP status code - 440

...