| Server IP : 138.197.176.125 / Your IP : 216.73.217.122 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/soltelcocrm/ |
Upload File : |
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://172.22.22.184/login',
CURLOPT_PORT => 1653,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_HEADER => true,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"payload": {
"username": "crm",
"password": "QWJjMTIzQEA="
}
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
),
));
$response = curl_exec($curl);
$header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
$header = substr($response, 0, $header_size);
$arrheader = explode(':', $header);
$arrCookie = explode('=', $arrheader[4]);
$arrTemp = explode(';',$arrCookie[1]);
$arrExtraInfo = explode(';',$arrheader[7]);
curl_close($curl);
$token = $arrTemp[0];
//echo $arrExtraInfo[0]."===".$token;
/*$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '172.22.22.184:1653/subscriber/bundle',
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 =>'{
"paymentInfo": {
"mobileNumber": "252647000018",
"paymentMethod": "MainAccount",
"bundleId": 162
},
"subscriptionId": "252647000018"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Cookie:'.$arrExtraInfo[0].'; token='.$token
),
));
$response = curl_exec($curl);
curl_close($curl);*/
$crmapirequest = '{
"files": {
"customerPhoto": "data:image/image/png;base64,iVBORw0KGgoAAAANSUhz/wEXkgk1zqgIHgAAAABJRU5ErkJggg==",
"identityDocumentType": 2,
"issuingDate": "2021-07-28",
"issuingCountryId": 204,
"expiryDate": "2021-05-28",
"identityDocumentScan": "data:image/image/png;base64,iVBORw0KGhOcBssI3QUUQE+U/qAVFQBAI4Vtl3HgAUYGdyErkJggg=="
},
"payload": {
"customerInfo": {
"identityTypeId": "5",
"mobileNo": "252698547124",
"customerClassId": "1",
"firstName": "Default",
"middleName": "Testing",
"lastName": "Customer",
"fourthName": "Abhe",
"motherName": "Got it",
"emailAddress": "252698547124@nomail.com",
"documentTypeId": "2",
"idNo": "12243412",
"nationality": "204",
"educationLevelId": "7",
"jobInformation": "Jaggernaut",
"monthlyIncomeRangeId": "3",
"languageId": "1",
"customerRecordNo": "Archive Reference Number 1234",
"Archive Reference Number": "MA",
"dateOfBirth": "1991-07-01",
"placeOfBirth": "Place of Birth",
"countryID": "204",
"stateID": "2",
"cityID": "2",
"inheritorInfo": {
"tel": "252698547124",
"nokName": "Inheritor name Awas",
"idCardNo": "123456881223",
"relationWithCustomer": "Relationship",
"address": "Inheritor address"
},
"addresses": [
{
"AddressTypeId": "1",
"isUrban": "1",
"addressLine1": "12",
"addressLine2": "543",
"countryID": "204",
"stateID": "1",
"cityID": "1",
"subCity": "Coychi",
"sector": "sector 1",
"zipCode": "1221",
"faxNum": "123456789"
}
],
"contactPersonInfo": {
"mobileNo": "252698547124",
"partnerContactPersonName": "Contact Person Name",
"address": "Contact person address"
}
},
"subscriberInfo": {
"subscriptionTypeId": "1",
"subscriptionId": "252647000020",
"userName": "252698547124",
"password": "P@kistan123",
"deviceTypeId": "1",
"deviceId": "",
"IMSI": "",
"ICCId": "",
"phoneBrand": "",
"phoneModel": "",
"paymodeId": "1",
"offerId": "42",
"languageId": "1"
},
"accounts": [
{
"accountTitle": "First Name Last Name Account",
"accountTypeId": "0",
"currencyId": "250",
"accountProfileId": "177",
"accountExpirydate": "2022-07-28",
"isExternalAccount": "0",
"parentAccountID": "0",
"isglAccount": "0",
"cvv": "",
"bank": "515"
}
]
}
}';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL =>'http://172.22.22.184:1653/customers/create',
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 =>$crmapirequest,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Cookie:'.$arrExtraInfo[0].'; token='.$token
),
));
$response = curl_exec($curl);
$arrResponse = json_decode($response);
echo "<pre>";
print_r($arrResponse);
curl_close($curl);