fbpx

< / >

Insert

Insert many

URL:

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

Description:

The “insert” API allows us to insert multiple records into the configured modules of our CRM by sending parameters.

¿How it works?:

This API operates through a “raw” type body and a POST request, which requires the following fields for proper functioning:

In the request headers, the following is required:

  • Wolkvox-Token

– In the request body, the following is required:

  • operation
  • module
  • fields

REQUEST

KEY
DESCRIPTION
EXAMPLE
Wolkvox-Token
It’s the token configured by the client on the CRM page.
A8K3J7F2
operation
It’s the name of the CRM operation.
“operation”: “testmodule”
module
Module name we will use for insertion.
“module”: “contacts”
fields
This is the field we will use to insert the entire form of our CRM. It must be used under the structure of an object.
“fields”: [ { “namecontact”: “value”, “telephonecontact”: “value”, “idcontact”: “value”, “Tipo Cliente”: “value”, “Tipo de cliente”: “value”, “Email”: “value” }, { “namecontact”: “value”, “telephonecontact”: “value”, “idcontact”: “value”, “Tipo Cliente”: “value”, “Tipo de cliente”: “value”, “Email”: “value” } ]
fields
Some field types require defining the “type”. These are: Address, Search, Relationship, and Table.
“fields”: { “Category”: “Corn Cakes”, “Product”: “Corn cakes must have butter”, “Price”: 5500, “Address”: { “type”: “address”, “value”: “145a Street #12-60” }, “Favorite Products”: { “type”: “table”, “value”:[{“Clothing”:”T-shirts”},{“Meats”:”Fish”},{“Other options”:”Solid Gold”}] } }

REQUEST

				
					$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://{{wolkvox_server}}/server/API/v2/custom/insertMany.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": "",
    "module": "",
    "fields": [{}]
}',
  CURLOPT_HTTPHEADER => array(
    'Wolkvox-Token: {{Wolkvox-Token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

				
			

RESPONSE

KEY
DESCRIPTION
EXAMPLE
code
Indicates the response status code.
“code”: 200
error
Provides details about the error that occurred during the request.
“error”: “null”
msg
Displays a descriptive message about the result of the request.
“msg”: “Succesfully edit record”
data
It is the set of information obtained as a result of making the request.
				
					{
    "code": 200,
    "error": "null",
    "msg": "Succesfully create x record",
    "data": []
}
				
			
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