Yes it is, but you need the id from the measure or dimension. Specify that as qLibraryId. If you are refering to a measure, you also need to add qType:"measure", otherwise the api will assume it's a dimension.
For the visualization API this is described here:
Hope this helps