fbpx

< / >

Insert

Insert task-type activity

URL:

https://{{wolkvox_server}}/server/API/v2/custom/insert.php

Description:

The following API configuration allows us to add task-type activities in the modules of our CRM.

How it works?

This API operates through a POST request, which requires the following fields for its proper functioning:

In the request headers, the following is required:

  • Wolkvox-Token: {{token}}
  • Content-Type: application/json

 

– In the request body, the following is required:

  • operation
  • module
  • fields
  • status
  • name
  • priority
  • name_module
  • completion_date
  • remember
  • reminder_date
  • description
  • id_record
  • wolkvox_owner

REQUEST

KEY
DESCRIPTION
EXAMPLE
Wolkvox-Server
Server nomenclature of the operation.
wolkvox_server.crmvox.com
Wolkvox-Token
Token generated in the CRM module where you will consume the API.
token
operation
It is the name of the CRM operation.
“My-CRM-operation”
module
Used to indicate that an insertion in the CRM activity list is desired.
“module”:”wolkvox_activities”
type
Type of activity to create.
“type”: “task”
fields
It is the set of attributes or data parameters sent to the API to create a new task in the selected module. Each field corresponds to a specific piece of information about the task, such as its status, name, priority, completion date, etc. The API expects these fields in JSON format, where each field is represented as a key-value pair.
“fields”: { }
status
Activity status.
“status”: “created”
name
Activity name.
“name”: “Activity name”
priority
Activity priority. The value can be “high”, “normal”, or “low”.
“priority”: “low”
name_module
Name of the module where you want to add the activity.
“name_module”: “cases”
completion_date
Completion date of the activity in year-month-day hour-minute-second format.
“completion_date”: “2023-07-30 00:00:00”
remember
Indicates whether you want to activate (true) or deactivate (false) a reminder.
“remember”: true
reminder_date
Sets the date for when you want the reminder to be activated. The format is year-month-day hour-minute-second.
“reminder_date”: “2023-07-29 00:00:00”
description
Activity description.
“description”: “This is an activity description.”
id_record
Identification code of the selected module record where you want to add the activity.
“id_record”: “Id record”
wolkvox_owner
Owner user of the activity.
“wolkvox_owner”: “ADMIN_@mymodule”

REQUEST

				
					$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://{{wolkvox_server}}/server/API/v2/custom/insert.php',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
   "operation": "{{operation}}",
   "module": "wolkvox_activities",
   "type": "task",
   "fields": {
       "status": "created",
       "name": "{{name}}",
       "priority": "{{priority}}",
       "name_module": "{{module}}",
       "completion_date": "{{YYYYmmdd HHiiss}}",
       "remember": "{{remember}}",
       "reminder_date": "{{YYYYmmdd HHiiss}}",
       "description": "{{description}}",
       "id_record": "{{id record}}",
       "wolkvox_owner": "{{owner}}"
   }',
  CURLOPT_HTTPHEADER => array(
    'Wolkvox-Token: {{token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
				
			

RESPONSE

				
					{
    "code": 200,
    "error": "null",
    "msg": "Succesfully create record",
    "data": {
        "wolkvox_id": " "
    }
}
				
			
Possible error codes

Usamos cookies, se continuar a navegar assumimos que concorda. Pode ler mais sobre a utilização de cookies nas nossas políticas de privacidade e tratamento de dados pessoais

We use cookies, if you continue browsing we will assume that you agree. You can read more about the use of cookies in our privacy policies and treatment of personal data