fbpx

< / >

Insert

Insert Cases with Attachments

URL:

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

Description:

The following API configuration allows us to add cases with attachments.

How does it work?

This API works through a POST request, which requires the following fields for its correct operation:

The following headers are required in the request:

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

– In the request body, the following fields are required:

  • operation
  • case-type
  • responsible
  • owner
  • contact
  • description
  • form
  • status
  • priority
  • attachments

REQUEST

KEY
DESCRIPTION
EXAMPLE
Wolkvox-Server
Operation server nomenclature.
‘https://wolkvox_server.crmvox.com/server/API/v2/cases/insertAttach.php’
Wolkvox-Token
Token generated in the CRM module where you will consume the API.
‘Wolkvox-Token: token’
operation
Operation name.
“operation”: “TheOperationName”
case-type
Case type.
“case-type”: “Request”
responsible
Case responsible.
“responsible”: “ADMIN_@mymodule”
owner
Case owner.
“owner”: “ADMIN_@mymodule”
contact
Contact related to the case.
“contact”: “[email protected]
description
Case description.
“description”: “This is the case description.”
form
This field is used to specify additional details of the case.
“form”:{ “Subject”: “This is an additional field created in the CRM.” }
status
Indicates the current status of the case.
“status”: “open”
priority
Sets the priority of the case.
“priority”: “low”
attachments
You can add attachments in base64 here.
“attachments”: [ ]

REQUEST

				
					$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://{{wolkvox_server}}/server/API/v2/cases/insertAttach.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}}",
    "case-type":"{{case type}}",
    "responsible":"{{responsible}}",
    "owner":"{{owner}}",
    "contact":"{{contact}}",
    "description":"{{description}}",
    "form":{
      "Subject": "{{subject}}"
    },
    "status": "{{status}}",
    "priority":"{{priority}}",
    "attachments": [  ]
}',
  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": " ",
        "idPrefijo": " "
    }
}
				
			
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