The determination of the fundamental properties (mass, separation, age, gravity, and atmospheric properties) of brown dwarf companions allows us to infer crucial informations on their formation and evolution mechanisms. Spectroscopy of substellar companions is available to date only for a limited number of objects (and mostly at very low resolution, R < 50) because of technical limitations, i.e. contrast and angular resolution. We present medium resolution (R = 350), coronagraphic long-slit spectroscopic observations with SPHERE of two substellar companions, HD 1160 B and HD 19467 B. We found that HD 1160 B has a peculiar spectrum that cannot be fitted by spectra in current spectral libraries. A good fit is possible only considering separately the Y+J and the H spectral band. The spectral type is between M5 and M7. We also estimated a Teff of 2800–2900 K and a log g of 3.5–4.0 dex. The low surface gravity seems to favour young age (10–20 Myr) and low mass (∼20 MJup ) for this object. HD 19467 B is instead a fully evolved object with a Teff of ∼1000 K and log g of ∼5.0 dex. Its spectral type is T6 ± 1.