Jump to content

API getProducts


flanderp

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

 

 

 

Link to comment
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

 

 

 

Link to comment
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

 

Link to comment
Share on other sites

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

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