Contents
On this page
Restore CRM Connection - Plugixa Chat
POST /plugixa-chat/v1/crm/{id}/restore
Bring a trashed CRM connection back, exactly as it was when it was deleted.
Needs Plugixa Chat Pro. The signed-in user needs the plugixa_chat_delete capability, the same one deleting needs. Administrators have it.
The stored API key was erased when the connection was deleted, so it comes back with has_key set to false.
Note. A CRM connection that is not in the trash answers
404, the same as an id that does not exist.
Request
POST https://your-site.example/wp-json/plugixa-chat/v1/crm/6/restore
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The CRM connection’s id |
Responses
200 OK. The CRM connection is live again.
{
"success": true,
"data": {
"restored": true
}
}
| Field | Type | Meaning |
|---|---|---|
data.restored |
boolean |
Always true |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_chat_not_found |
No CRM connection has this id, or it is not in the trash. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-chat/v1/crm/6/restore" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chat/v1/crm/6/restore');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-chat/v1/crm/6/restore', {
method: 'POST',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share