Jake Posted April 14, 2020 Report Share Posted April 14, 2020 I am using the API and I have successfully connected and used it to do other tasks like creating a user. I am trying to add a service for a user and I am running up against an error: I am executing the following code: $BlestaCreateData = array( 'vars' => array( 'client_id ' => 1512, 'use_module ' => false, 'pricing_id' => 19, 'packages' => array(15) ) ); $response = $this->blestaapi->post('services', 'add', $BlestaCreateData); echo '<pre>'; $RetVal = $response; echo var_dump($RetVal); When I execute the code I am getting the following error: object(BlestaResponse)#34 (2) { ["raw":"BlestaResponse":private]=> string(143) "{"message":"The request cannot be fulfilled due to bad syntax.","errors":{"client_id":{"exists":"The client does not exist."}},"response":null}" ["response_code":"BlestaResponse":private]=> int(400) } I am not sure if I should pass the database id value from the clients table or the id_value. I've tried both and I keep getting the same error. Is there something I am missing? Quote Link to comment Share on other sites More sharing options...
Jake Posted April 14, 2020 Author Report Share Posted April 14, 2020 Now I feel really stupid. I had spaces in the array keys. This is fixed. Sorry to waste everyone's time Quote Link to comment Share on other sites More sharing options...
Paul Posted April 14, 2020 Report Share Posted April 14, 2020 19 hours ago, Jake said: Now I feel really stupid. I had spaces in the array keys. This is fixed. Sorry to waste everyone's time Looks like you figured it out before anyone had a chance to look into it. Glad to hear it's working now! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.