Jump to content

lawrence-ytz

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by lawrence-ytz

  1. 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?

  2. 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 optional

     

    My 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);
  3. 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 client
    array(
                    '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);
      
    }
  4. 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'
    ),
×
×
  • Create New...