[SalesForce] Rest API to query for Products and prices

I have been asked to design some new forms that create Orders in Salesforce. To achieve this I call the webservices often using Query. For these new forms that are related to Ordering I had hoped to Query the Product2/PriceBook2/PriceBookEntry objects as this is where the data is stored.

I am currently testing via hurl.it and the URL to call (with the correct authorisation) is simplified to this query:

https://XXXX.salesforce.com/services/data/v32.0/query?q=SELECT+Id+FROM+Product2

Which returns the error code:

INVALID_TYPE

The query is simply:

SELECT Id FROM Product2

This works in the developer console.The user does have activate orders and edit activate order permission.

Can anyone confirm if it is simple NOT Possible to query these objects in this fashion? What is an alternative (this is simple…enough for me).?

If it is not possible to query, I am able to hard code the products onto the form I am developing (they don't change often and there aren't many) and then create the Order/Line Items directly via the Web Service (including Activating it) – I haven't got this far but I hope it is all possible.

Best Answer

It was permissions:

The API user I was using simply record Read access to Products and Price Books.

I would usually delete this question to avoid embarrassment but too late for that.

Related Topic