Contents
On this page

Check CRM Connection - Plugixa Chat

POST /plugixa-chat/v1/crm/{id}/check

Check that a connection’s stored key still works and that its list still exists.

Needs Plugixa Chat Pro. The signed-in user needs the plugixa_chat_edit capability. Administrators have it.

Request

POST https://your-site.example/wp-json/plugixa-chat/v1/crm/6/check

Path parameters

Name Type Description
id integer The connection’s id

Responses

200 OK. The key works; data.ok says whether the list was found.

{
  "success": true,
  "data": {
    "ok": true,
    "message": "Connected. New contacts go to “Newsletter”."
  }
}
Field Type Meaning
data.ok boolean true when the saved list is among the account’s lists
data.message string A sentence for a person, in the site’s language

Errors

Status Code When
404 plugixa_chat_not_found No connection has this id, or it is in the trash.
400 plugixa_chat_crm_key The stored key is missing or no longer accepted.
400 plugixa_chat_crm_fluent FluentCRM is not active on this site.
502 plugixa_chat_crm_unreachable The service answered with an error (500 for FluentCRM).

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-chat/v1/crm/6/check" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chat/v1/crm/6/check');
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/check', {
  method: 'POST',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share