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());

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...