Erro 403 Access denied na API
Enviado: 15 Abr 2021, 13:05
Olá pessoal, estou tentando resolver um problema.
Quando tento fazer um update em uma tabela retorna esse erro 403 Access denied.
Se tentar buscar todos dados da tabela ou filtrar funciona perfeitamente.
Nunca fiz um delete, insert ou update!
Estou testando um update de descricao de categoria, também já tentei na tabela country.
Segue código:
Alterei de servidor e mudei o código:
Quando tento fazer um update em uma tabela retorna esse erro 403 Access denied.
Se tentar buscar todos dados da tabela ou filtrar funciona perfeitamente.
Nunca fiz um delete, insert ou update!
Estou testando um update de descricao de categoria, também já tentei na tabela country.
Segue código:
Código: Selecionar todos
Acho que era o servidor.$data = array('name' => 'Softwares 2021');
$open_tabela = 'oc_category_description';
curl_setopt_array($ch, [
CURLOPT_URL => 'http://openstore.byethost12.com/api.php/'.$open_tabela.'/17,2',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_PUT => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false
]);Alterei de servidor e mudei o código:
Código: Selecionar todos
Funcionou e a exclusão também.$ch = curl_init();
$data = array('name' => 'Afghanistan 2021');
curl_setopt_array($ch, [
CURLOPT_URL => 'https://open.createlogics.com.br/api.php/country/2',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false
]);