Jump to content

Recommended Posts

Posted

I have created a package which pricing id is 1. I want to add this service under the client id 1. Below is my code: 

$api = new BlestaApi($url, $user, $key);
$data= array('vars'=>array('pricing_id'=>1,'client_id'=>1,'qty'=>1));				
$response = $api->post("Services", "add", $data);
print_r($response->response());
var_dump($response->errors());
 

second last line output blank.

last line output bool(false).

 

This code was working for me before flushing database. I flushed old data because of testing records. 

 

Please let me know what I am doing incorrect.

 

Thanks in advance!

 

-Anuranjan

Posted

What do you mean you 'flushed' the database? Obviously, if you have removed the client, pricing, package, or associated module data, a service could fail to add. If no errors exist, check your API credentials. You may also check the raw response from the request

var_dump($response->raw());

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...