Jump to content


API v2 Error 403


2 replies to this topic

#1 gleisonmaia

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 27 August 2018 - 12:19 PM

We performed the test replicating exactly the Knowledge Base Entry example, but the error was returned:
HTTP / 1.1 403 Forbidden (Error: LZAV20001: Invalid Authentication (password not MD5 encoded?); 0)

Our version of Livezilla Server is 7.1.0.5 and the user is allowed to make API calls, please tell us where we might be going wrong.

Here is sample code from our test:

<?php
$livezillaURL = "http://10.0.2.1:8081/livezilla/";
		$apiURL = $livezillaURL . "api/v2/api.php";		// authentication parameters
		$postd["p_user"]='administrator';
		$postd["p_pass"]=md5('123456');
				// function parameter
		$postd["p_knowledgebase_entry_create"]=1;
		$postd["p_json_pretty"]=1;		$bla = [
			'Tags' => "car, sharing",
			'Value'=> "Content goes here ....",
			'Title'=> "Where to find car sharing stations?",
			'ParentId'=> "",
			'Type'=> 1,
			'IsPublic'=> 1,
			'FulltextSearch '=> 1,
			'ShortcutWord '=> "myshortcut",
			'AllowBotAccess '=> 1
		];		$newKBEntry = (object) $bla;
		$postd["p_data"]= json_encode(array("KnowledgeBaseEntry" => $newKBEntry));
		$ch = curl_init();		curl_setopt($ch, CURLOPT_URL,$apiURL);
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postd));
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		$server_output = curl_exec($ch);		if($server_output === false)
			exit(curl_error($ch));
		echo $server_output;
		curl_close($ch);
?>


#2 a.torcz

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 01 October 2018 - 01:54 PM

I have the same problem. Unfortunately I don't get an answer from support. Can someone help me?

#3 Patrick Keil

    Administrator

  • Administrators
  • 3635 posts
  • LocationSingen, Germany

Posted 02 October 2018 - 11:28 AM

Hi,

Please use the example code from the API documentation.

I just tested the example code (added correct auth details and a valid folder parent id) and it works fine.

Please understand that we can't troubleshoot your specific code.

Thanks.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users