Segment by customdimension

I am getting data of one customDimension by calling CustomDimensions.getCustomDimension. Now i want to segment this call with another custom dimension. Is it possible?

I’ve found the solution myself. The name for segmentation is dimension1 and so on. I really don’t know why this information is missing from documention! see : Segmentation: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3