Function swpbThreadInsert
Arguments
$parameters = array(
[ 'group' ] = '' ; // optional thread group name ( max 32 chars )
[ 'status' ] = '' ; // required status active | finished | rejected ( default is active )
[ 'origin' ] = '' ; // optional object/query origin eg. www, phone, visit in office etc ...
[ 'title' ] = '' ; // required thread title
[ 'idCompany' ] = '' ; // optional crm customer company id
[ 'idPerson' ] = '' ; // optional crm customer person id
[ 'name' ] = '' ; // optional customer name
[ 'surname' ] = '' ; // optional customer surname
[ 'organisationName' ] = '' ; // optional customer organisation/company surname
[ 'phoneNumber1' ] = '' ; // optional customer phone number 1
[ 'phoneNumber2' ] = '' ; // optional customer phone number 2
[ 'email' ] = '' ; // optional customer email
[ 'city' ] = '' ; // optional customer city
[ 'www' ] = '' ; // optional customer www
[ 'nextContactDate' ] = '' ; // optional contact date YYYY-MM-DD ( default id `today` )
[ 'idPersonCrmUser' ] = '' ; // optional ksi crm user id. Default value will be get form parameteters
// $userDBConfig [ 'crmUser' ][ 'person' ][ 'id' ]
// CRMParameters::get ( "API", 'konfiguracja', 'uzytkownik', 'id-osoby' ) ;
[ 'idSource' ] = '' ; // optional CRM source entity id
[ 'source' ] = '' ; // optional CRM entity name eg. R2 | OFERTY_WWW | FAKTURY etc ...
)
Returns
Status information and created thread id.
array (
[ 'status' ] = 'OK',
[ 'idThread' ] = 'XXXXXXXXXXXXXXXX',
)
or
array (
[ 'status' ] = 'FAIL',
[ 'errors' ] = array( ... ),
)
Example
require_once ( 'classUddsOx.php' ) ;
$udds = new classUddsOx ;
$udds->customerCode = [your_customerCode] ;
$udds->login = [your_login] ;
$udds->password = [your_password] ;
$udds->serverUrl = 'http://api.dlaoperatora.pl/udds/' ;
$myParams = array() ;
$myParams [ 'group' ] = 'offer' ;
$myParams [ 'status' ] = 'active' ;
$myParams [ 'origin' ] = 'www-form-small' ;
$myParams [ 'title' ] = 'Zapytanie dot. oferty XXX' ;
$myParams [ 'name' ] = 'Tomasz' ;
$myParams [ 'surname' ] = 'Testowski' ;
$myParams [ 'phoneNumber1' ] = '609040000' ;
$myParams [ 'email' ] = 'kasiatest@testowex.nn' ;
$myParams [ 'city' ] = 'Warszawa' ;
$myParams [ 'www' ] = 'http://www.oferty.pl/oferta_wakacje_23432.html' ;
$ret = $udds->swpbThreadInsert( $myParams ) ;
Returns $ret =
array (
[ 'status' ] = 'OK',
[ 'idThread' ] = 'XXXXXXXXXXXXXXXX',
)