Olá Amigos, possuo um código em PHP que lista duas API’s, porém precisava levar o código para ASP
existe algum programa que traduza o código, ou algo do gênero ?
<?php
if (isset($_GET['GeraChamado'])) {
$chave = $_GET['chave'];
$chavecliente = $_GET['chave_cliente'];
$verchamado = $_GET['ver_chamado'];
$verassunto = $_GET['ver_assunto'];
$verstatus = $_GET['ver_status'];
$verfantasia = $_GET['ver_fantasia'];
$ondedisp = $_GET['onde_disp'];
$ondeexcluido = $_GET['onde_excluido'];
$ondedatacri = $_GET['onde_datacri'];
}
$url = 'https://desk.ms/integracao/API/lchamados/';
$fields = array(
'chave' => $chave,
'ver_chamado' => $verchamado,
'ver_assunto' => $verassunto,
'ver_status' => $verstatus,
'onde_datacri' => $ondedatacri);
$fields_string = '';
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
$urlc = 'https://desk.ms/integracao/API/lclientes/';
$fieldsc = array(
'chave' => $chavecliente,
'ver_fantasia' => $verfantasia,
'onde_datacri' => $ondedatacri,
'onde_disp' => $ondedisp,
'onde_excluido' => $ondeexcluido);
$fields_stringc = '';
foreach($fieldsc as $keyc=>$valuec) { $fields_stringc .= $keyc.'='.$valuec.'&'; }
rtrim($fields_stringc, '&');
$ch = curl_init();
curl_setopt($chc,CURLOPT_URL, $urlc);
curl_setopt($chc,CURLOPT_POST, count($fieldsc));
curl_setopt($chc,CURLOPT_POSTFIELDS, $fields_stringc);
curl_setopt($chc, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($chc, CURLOPT_HEADER, 0);
curl_setopt($chc, CURLOPT_RETURNTRANSFER, 1);
$resultc = curl_exec($chc);
curl_close($chc);
echo $resultc;
?>