Jump to content

mesino

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

mesino's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. @Tyson I have also stumbled across this issue of non-clients (who view a ticket via email link) being unable to close the tickets. This is on a fresh install with no extra plugins. Is that by design or is this indeed a bug?
  2. Thanks for the clarification.
  3. Nevermind It was pretty easy.
  4. Thanks. I am yet to learn plugin-creation on Blesta though :-( Wish there existed a bare skeleton to start working on top of it. All such resources I could find on the web were for Blesta 3.x.
  5. Hi. I am trying to use PHP-Curl to create a ticket via Blesta API and have a few queries: As per my understanding, in order to create a new ticket you need two HTTP calls. One for add() and another for addReply(). Is that correct? Secondly is there is working example of posting files along with the call to create a ticket. The parameter's explanation for it is a bit vague: * @param array $files A list of file attachments that matches the global FILES array Firstly I am not sure what should the structure of $files should be. Furthermore when I went through the code it appeared that the addReply method will only make use of '$files' array posted by API instead of $_FILES (only which can have the local 'tmp_name' of uploaded files). $this->Upload->setFiles($files, false); but $files is supplied remotely. I hope I am making some sense here. Thanks.
  6. Hi @Tyson I had tried NULL but that also results in the same error: <?php require_once "blesta_api.php"; $user = "{API_USER}"; $key = "{API_USER}"; $url = "{API_URL}"; $api = new BlestaApi($url, $user, $key); $response = $api->post("encryption", "systemEncrypt", array('value' => 'my text', 'key' => NULL, 'iv' => NULL)); print_r($response->response()); print_r($response->errors()); exit; ?> Output: Internal error: Failed to retrieve the default value stdClass Object ( [error] => stdClass Object ( [message] => An unexpected error occured. [response] => Internal error: Failed to retrieve the default value ) )
  7. After some hit & trial and following hints on the API doc page, I realized that supplying values of optional arguments suppresses the error: $response = $api->post("encryption", "systemEncrypt", array('value' => 'my text', 'key' => 'my key', 'iv' => 'my iv')); works. Even blank values work: $response = $api->post("encryption", "systemEncrypt", array('value' => 'my text', 'key' => '', 'iv' => '')); As per the API and class docs, without the optional arguments, Blesta should encrypt/decrypt using the Blesta.system_key. But omitting these arguments results in an error as shown in the original post. Copy-pasting the system_key from config/blesta.php into 'key' and 'iv' values solves it for me and produces the desired result but this is far from ideal.
  8. Hi. For some custom integration of Blesta, I have been trying the API examples listed here to make myself familiar with the API: https://docs.blesta.com/display/dev/API While: $response = $api->get("users", "get", array('user_id' => 1)); gives expected results, for some reason: $response = $api->post("encryption", "systemEncrypt", array('value' => "my text")); fails with: Class Object ( [error] => stdClass Object ( [message] => An unexpected error occured. [response] => Internal error: Failed to retrieve the default value ) ) Will really appreciate some pointers. Thanks in advance.
×
×
  • Create New...