API for Email marketing services: Difference between revisions

From Planfix
Jump to: navigation, search
Line 71: Line 71:
}
}
</pre>
</pre>
=== deleteList — Удаление списка рассылки ===
=== deleteList — Delete a mailing list ===
'''Описание:''' Удаляет список рассылки по его идентификатору.
'''Description:''' Deletes a mailing list by its identifier.


'''Запрос:'''
'''Запрос:'''
Line 78: Line 78:
{
{
   "action": "deleteList",
   "action": "deleteList",
   "authToken": "ваш_токен_авторизации",
   "authToken": "your_authorization_token",
   "data": {
   "data": {
     "listId": "идентификатор_списка"
     "listId": "list_identifier"
   }
   }
}
}
</pre>
</pre>


'''Ответ (успех):'''
''''Response (success):'''
<pre>
<pre>
{
{
Line 92: Line 92:
</pre>
</pre>


'''Ответ (ошибка):'''
'''Response (error):'''
<pre>
<pre>
{
{
   "error": "Описание ошибки"
   "error": "Error description"
}
}
</pre>
</pre>

Revision as of 09:43, 5 March 2025

This API was developed to integrate with external email services. It allows you to manage mailing lists and contacts via a single endpoint (e.g., https://yourserver.com/planfix_integration.php) and accepts requests in JSON format.

Once you have implemented the integration, you can contact our Support Service to add your service to the list of integrations available to users in the Planfix interface.

Connecting to Planfix

  • Go to the Account management — Integrations — Email marketing section to connect and configure the integration.
  • In the opened section, select Planfix API at the end of the list.
  • A window for the integration settings will open.
  • You must specify the address where Planfix should send the requests and the API Key for authorization.

Request format

The request is sent via POST method in JSON format to the address specified in the integration settings.

Request Example:
{
  "action": "action",
  "authToken": "your_authorization_token",
  "data": {
    // Data depending on the action
  }
}

Request Parameters:

Name Description Type/Data Format Note
action The action to be performed string
authToken Authorization token for API access string
data Data depending on the action object

Supported actions

createList — Create a mailing list

Description: Creates a new mailing list with the specified name.

Request:

{
  "action": "createList",
  "authToken": "your_authorization_token",
  "data": {
    "listName": "List name"
  }
}

'Response (success):

{
  "success": true,
  "listId": "unique_list_identifier""
}

Response (error):

{
  "error": "Error description"
}

deleteList — Delete a mailing list

Description: Deletes a mailing list by its identifier.

Запрос:

{
  "action": "deleteList",
  "authToken": "your_authorization_token",
  "data": {
    "listId": "list_identifier"
  }
}

'Response (success):

{
  "success": true
}

Response (error):

{
  "error": "Error description"
}