Jump to content

Recommended Posts

Hi, 

I am having difficulties understanding the help for getProducts, 

Passing 

Quote

array(
                'action' => 'getProducts',
                'pid'=>'1',         
            );

results in 

Quote

(
    [result] => error
    [message] => Error generating JSON encoded response: Malformed UTF-8 characters, possibly incorrectly encoded
)

if i add module 

Quote

array(
                'action' => 'getProducts',
                'pid'=>'1',
                'module'=>'None',
            );

results in 

Quote

stdClass Object
(
    [result] => success
    [totalresults] => 0
)

Although module according to the documentation is "optional" ? , also tried a number of different PID's for valid products.

Essentially i am trying to retrieve a list of all products so that i can search through the names for a match in a CSV file then add the product to a specific client using the PID retrieved from "getProducts", or at least i thought that was the right way to go.

WHMCS 7.7.1

Any help much appreciated 

Thanks 

Paul

 

 

 

Share this post


Link to post
Share on other sites

What exactly are you trying to use this on? I actually use this with the WHMCS Licensing Addon. 

Share this post


Link to post
Share on other sites

Hi, 

I may be going about it the wrong way....

I have a large csv file which includes client , contacts , company and product 

I have created all products using the whmcs admin panel 

I have added the users using the API along with adding all the contacts 

Upto this point all is good .....

Now i need to search the list of products in WHMCS for a match against the name (Which corresponds to the name in my CSV) to retrieve the PID , i can then add the order to the client using this PID and change it from pending to active. 

The only part i am struggling with is retrieving a list including the PID of all products i thought getProducts excluding the PID might give me this information.

Any help appreciated 

Thanks 

Paul

 

 

 

Share this post


Link to post
Share on other sites

Hi , 

I have found the issue. 

Its a problem with the data within the DB , it looks like the database has the wrong colation UTF-8 type which has resulted in  data being stored in the wrong format. 

I need to now find a way to convert the data.

Paul

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated