We use the correlation relation between the energy emitted by the GRBs in their prompt phases and the X-ray afterglow fluxes, in an effort to constrain cosmological parameters and aiming to construct a Hubble diagram at high redshifts, i.e. beyond those found with Type Ia supernovae.We use a sample of 126 Swift GRBs, that we have selected among more than 800 long bursts observed until April 2015. The selection is based on a few observational constraints: GRB flux higher than 0.4 photons/cm 2 /s in the band 15-150 keV; spectrum fitted with simple power law; redshift accurately known and given; and X-ray afterglow observed and flux measured.The statistical method of maximum likelihood is then used to determine the best cosmological parameters (Ω M , Ω Λ ) that give the best correlation for two relations: a) the Amati relation (between intrinsic spectral peak energy E p,i and the equivalent isotropic energy); b) the Dainotti relation, namely between the Xray afterglow luminosity L X and the break time T a , which is observed in the X-ray flux FX.Although the number of GRBs with high redshifts is rather small, and despite the notable dispersion found in the data, the results we have obtained are quite encouraging and promising. The results obtained using the Amati relation are close to those obtained using the Type Ia supernovae, and they appear to indicate a universe dominated by dark energy. However, those obtained with the correlation between the break time and the X-ray afterglow luminosity is consistent with the findings of the WMAP study of the cosmic microwave background radiation, and they seem to indicate a de Sitter-Einstein universe dominated by matter.