lawrence-ytz
-
Posts
16 -
Joined
-
Last visited
Posts posted by lawrence-ytz
-
-
found it, Clients:getCustomFieldValues, but it returns nothing, no response, no errors
$data = array('client_id' => $client_id);$response = $api->get("Clients", "getCustomFieldValues", $data);print_r($response->response());print_r($response->errors()); -
I need to get the value of a custom field based on either client_id or username from an API call in an external application. I was hoping wither Users::getByUsername or Clients:getSettings would return the custom fields, but they don't. Anyone know how I can accomplish this?
-
Thanks, that solved it.
-
Well I wouldn't want to set remember_me to true to get around it.
I've given up on users::login, and am now trying to use users::auth, but it keeps returning false, is the password parameter plane text or encrypted?
-
So how can the Session Cookie be set if the api only supports calling Model methods, and setSessionCookie is a component?
-
I'm having the similar issue, what type of data needs to be passed in the Session parameter?
The error I'm recieving is:
object(stdClass)#4 (1) { ["error"]=> object(stdClass)#3 (2) { ["message"]=> string(28) "An unexpected error occured." ["response"]=> string(25) "Parameter is not optional" } }
Parameter is not optionalMy code is as below:
$data = array('Session' => 123456,'vars' => array('username' => $email,'password' => $password,'remember_me' => false,'ip_address' => '1.1.1.1'));$response = $api->post("users", "login", $data); -
So that looks like it's a no? It also looks like it's not resolved, anyone have an idea how or if any of the other plugins are doing it?
-
Does anyone know if the Services.edit event will be triggered when a scheduled cancellation or another automated change to the service occurs?
-
any help? Something was also preventing an external api call from returning a response when creating a client.
-
field is already created in the admin. I can also update it via an api call from an external app, just not from within the blesta environment. A bit more info that may be helpfull, I'm trying to execture this from mycustom_plugin.php
-
I'm trying to set a custom field from with in a plugin when a new client is created. The event is is working, but either the model or method are not.
public function getEvents() {return array(// on create clientarray('event' => "Clients.create",'callback' => array("this", "run"))// on cancel service);}public function run($event) {Loader::loadModels($this, array("Clients"));$params = $event->getParams();$user_id = $params->id;//die( 'hello' ); //the event is firing at the correct time//update custom field$vars = array ('field_id' => 3,'client_id' => 352,'value' => 1111,);$this->Clients->setCustomField($vars);} -
problem was using custom field name vs id. Maybe a better layout for requirements and parameters in the docs.
-
solved, typo issue
-
I'm having trouble accessing only the value for client_id in the response, is there a way to return and store only the client_id of the response in a string?
-
I'm trying to submit a custom field value using the api for client create, and am getting the following error, stdClass Object ( [value] => stdClass Object ( [required] => my_custom_field is in an invalid format. ) )
The code is my vars is :
'custom' => array('my_custom_field' => '12345'),
Returning A Custom Field Value With The Api
in General
Posted
the client has a value set in the custom field. Absolutely nothing is returned.